Update to drupal 8.0.0-rc1. For more information, see https://www.drupal.org/node/2582663
This commit is contained in:
parent
eb34d130a8
commit
f32e58e4b1
8476 changed files with 211648 additions and 170042 deletions
36
core/modules/views/views.post_update.php
Normal file
36
core/modules/views/views.post_update.php
Normal file
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Post update functions for Views.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup updates-8.0.0-beta
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Update the cacheability metadata for all views.
|
||||
*/
|
||||
function views_post_update_update_cacheability_metadata() {
|
||||
// Load all views.
|
||||
$views = \Drupal::entityManager()->getStorage('view')->loadMultiple();
|
||||
|
||||
/* @var \Drupal\views\Entity\View[] $views */
|
||||
foreach ($views as $view) {
|
||||
$displays = $view->get('display');
|
||||
foreach (array_keys($displays) as $display_id) {
|
||||
$display =& $view->getDisplay($display_id);
|
||||
// Unset the cache_metadata key, so all cacheability metadata for the
|
||||
// display is recalculated.
|
||||
unset($display['cache_metadata']);
|
||||
}
|
||||
$view->save();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @} End of "addtogroup updates-8.0.0-beta".
|
||||
*/
|
Reference in a new issue