Commit e91604c3 authored by merlinofchaos's avatar merlinofchaos

#130381: (mgull) Clear the page cache after a view is saved or deleted so that...

#130381: (mgull) Clear the page cache after a view is saved or deleted so that anonymous users will see changes.
parent 0170a121
......@@ -33,6 +33,7 @@ Views 4.7.x-dev
o #127099 (Crell) Fix to views argument handling in RSS that made the RSS feeds fail in panels and viewfield.
o #130139: (simplymenotu) change changelog to top-down format.
o #130196: (the greenman) Views filters improperly ignored table aliasing.
o #130381: (mgull) Clear the page cache after a view is saved or deleted so that anonymous users will see changes.
New features:
o #105620: (Attempt 2) allow modules to alter views tables + arguments
......
......@@ -873,6 +873,7 @@ function views_theme_field() {
if ($func) {
return call_user_func_array($func, $args);
}
cache_clear_all(); //entire cache MUST be cleared, due to anonymous user page cache
}
/**
......@@ -1032,7 +1033,7 @@ function _views_delete_view($view) {
db_query("DELETE FROM {view_argument} where vid=%d", $view->vid);
db_query("DELETE FROM {view_tablefield} where vid=%d", $view->vid);
cache_clear_all('views_query:' . $view->name);
cache_clear_all(); // in Drupal 4.7 this clears everything.
}
/**
......@@ -1162,7 +1163,7 @@ function _views_save_view($view) {
db_query("DELETE from {view_filter} WHERE vid='$view->vid'");
db_query("DELETE from {view_exposed_filter} WHERE vid='$view->vid'");
cache_clear_all('views_query:' . $view->name);
cache_clear_all();
}
else {
// insert
......@@ -1205,7 +1206,7 @@ function _views_save_view($view) {
foreach ($view->exposed_filter as $i => $arg) {
db_query("INSERT INTO {view_exposed_filter} (vid, field, label, optional, is_default, single, operator, position) VALUES (%d, '%s', '%s', %d, %d, %d, %d, %d)", $view->vid, $arg['field'], $arg['label'], $arg['optional'], $arg['is_default'], $arg['single'], $arg['operator'], $i);
}
cache_clear_all('views_with_inline_args:');
cache_clear_all();
}
// ---------------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment