You are here

function views_invalidate_cache in Views (for Drupal 7) 8.3

Same name and namespace in other branches
  1. 5 views.module \views_invalidate_cache()
  2. 6.3 views.module \views_invalidate_cache()
  3. 6.2 views.module \views_invalidate_cache()
  4. 7.3 views.module \views_invalidate_cache()

Invalidate the views cache, forcing a rebuild on the next grab of table data.

5 calls to views_invalidate_cache()
ExposedFormTest::testRenameResetButton in lib/Drupal/views/Tests/Plugin/ExposedFormTest.php
Tests, whether and how the reset button can be renamed.
SettingsTest::testEditUI in lib/Drupal/views/Tests/UI/SettingsTest.php
Tests the settings for the edit ui.
ViewStorageController::postSave in lib/Drupal/views/ViewStorageController.php
Overrides Drupal\config\ConfigStorageController::postSave().
views_menu in ./views.module
Implement hook_menu().
views_ui_tools_clear_cache in views_ui/admin.inc
Submit hook to clear the views cache.

File

./views.module, line 1034
Primarily Drupal hooks and global API functions to manipulate views.

Code

function views_invalidate_cache() {

  // Clear the views cache.
  cache('views_info')
    ->flush();

  // Clear the page and block cache.
  cache_invalidate(array(
    'content' => TRUE,
  ));

  // Set the menu as needed to be rebuilt.
  state()
    ->set('menu_rebuild_needed', TRUE);

  // Allow modules to respond to the Views cache being cleared.
  module_invoke_all('views_invalidate_cache');
}