core/modules/book/lib/Drupal/book/BookManager.php | 2 +- .../lib/Drupal/book/Form/BookAdminEditForm.php | 23 +------------------- .../image/lib/Drupal/image/Entity/ImageStyle.php | 2 +- core/modules/locale/locale.module | 6 ++--- .../lib/Drupal/system/Form/PerformanceForm.php | 5 +++-- .../views/Plugin/views/cache/CachePluginBase.php | 4 ++-- core/modules/views/views.module | 7 +++--- 7 files changed, 15 insertions(+), 34 deletions(-) diff --git a/core/modules/book/lib/Drupal/book/BookManager.php b/core/modules/book/lib/Drupal/book/BookManager.php index 3f503ca..afdc638 100644 --- a/core/modules/book/lib/Drupal/book/BookManager.php +++ b/core/modules/book/lib/Drupal/book/BookManager.php @@ -606,7 +606,7 @@ protected function _menu_build_tree($bid, array $parameters = array()) { } $tree_cid = 'book-links:' . $bid . ':tree-data:' . $language_interface->id . ':' . hash('sha256', serialize($parameters)); - // If we do not have this tree in the static cache, check {cache_menu}. + // If we do not have this tree in the static cache, check {cache_data}. if (!isset($trees[$tree_cid])) { $cache = \Drupal::cache('data')->get($tree_cid); if ($cache && isset($cache->data)) { diff --git a/core/modules/book/lib/Drupal/book/Form/BookAdminEditForm.php b/core/modules/book/lib/Drupal/book/Form/BookAdminEditForm.php index fb9a1d3..41eb51f 100644 --- a/core/modules/book/lib/Drupal/book/Form/BookAdminEditForm.php +++ b/core/modules/book/lib/Drupal/book/Form/BookAdminEditForm.php @@ -9,7 +9,6 @@ use Drupal\book\BookManagerInterface; use Drupal\Component\Utility\Crypt; -use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Entity\EntityStorageControllerInterface; use Drupal\Core\Form\FormBase; use Drupal\node\NodeInterface; @@ -21,13 +20,6 @@ class BookAdminEditForm extends FormBase { /** - * The menu cache object for this controller. - * - * @var \Drupal\Core\Cache\CacheBackendInterface - */ - protected $cache; - - /** * The node storage controller. * * @var \Drupal\Core\Entity\EntityStorageControllerInterface @@ -44,15 +36,12 @@ class BookAdminEditForm extends FormBase { /** * Constructs a new BookAdminEditForm. * - * @param \Drupal\Core\Cache\CacheBackendInterface $cache - * The menu cache object to be used by this controller. * @param \Drupal\Core\Entity\EntityStorageControllerInterface $node_storage * The custom block storage controller. * @param \Drupal\book\BookManagerInterface $book_manager * The book manager. */ - public function __construct(CacheBackendInterface $cache, EntityStorageControllerInterface $node_storage, BookManagerInterface $book_manager) { - $this->cache = $cache; + public function __construct(EntityStorageControllerInterface $node_storage, BookManagerInterface $book_manager) { $this->nodeStorage = $node_storage; $this->bookManager = $book_manager; } @@ -63,7 +52,6 @@ public function __construct(CacheBackendInterface $cache, EntityStorageControlle public static function create(ContainerInterface $container) { $entity_manager = $container->get('entity.manager'); return new static( - $container->get('cache.data'), $entity_manager->getStorageController('node'), $container->get('book.manager') ); @@ -109,8 +97,6 @@ public function submitForm(array &$form, array &$form_state) { $order = array_flip(array_keys($form_state['input']['table'])); $form['table'] = array_merge($order, $form['table']); - // Track updates. - $updated = FALSE; foreach (element_children($form['table']) as $key) { if ($form['table'][$key]['#item']) { $row = $form['table'][$key]; @@ -122,7 +108,6 @@ public function submitForm(array &$form, array &$form_state) { $link['weight'] = $values['weight']; $link['pid'] = $values['pid']; $this->bookManager->saveBookLink($link, FALSE); - $updated = TRUE; } // Update the title if changed. @@ -137,12 +122,6 @@ public function submitForm(array &$form, array &$form_state) { } } } - if ($updated) { - // Flush static and cache. - drupal_static_reset('book_menu_subtree_data'); - $cid = 'book-links:subtree-cid:' . $form['#node']->book['nid']; - $this->cache->delete($cid); - } drupal_set_message($this->t('Updated book %title.', array('%title' => $form['#node']->label()))); } diff --git a/core/modules/image/lib/Drupal/image/Entity/ImageStyle.php b/core/modules/image/lib/Drupal/image/Entity/ImageStyle.php index a352fb8..700685c 100644 --- a/core/modules/image/lib/Drupal/image/Entity/ImageStyle.php +++ b/core/modules/image/lib/Drupal/image/Entity/ImageStyle.php @@ -259,7 +259,7 @@ public function flush($path = NULL) { field_info_cache_clear(); drupal_theme_rebuild(); - // Clear page caches when flushing. + // Clear render cache when flushing. \Drupal::cache('render')->deleteAll(); return $this; diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module index 2448d94..05424d8 100644 --- a/core/modules/locale/locale.module +++ b/core/modules/locale/locale.module @@ -244,7 +244,7 @@ function locale_stream_wrappers() { */ function locale_language_insert($language) { // @todo move these two cache clears out. See http://drupal.org/node/1293252 - // Changing the language settings impacts the interface. + // Changing the language settings impacts the interface: clear render cache. \Drupal::cache('render')->deleteAll(); // Force JavaScript translation file re-creation for the new language. _locale_invalidate_js($language->id); @@ -255,7 +255,7 @@ function locale_language_insert($language) { */ function locale_language_update($language) { // @todo move these two cache clears out. See http://drupal.org/node/1293252 - // Changing the language settings impacts the interface. + // Changing the language settings impacts the interface: clear render cache. \Drupal::cache('render')->deleteAll(); // Force JavaScript translation file re-creation for the modified language. _locale_invalidate_js($language->id); @@ -275,7 +275,7 @@ function locale_language_delete($language) { // Remove translated configuration objects. \Drupal\locale\Locale::config()->deleteLanguageTranslations($language->id); - // Changing the language settings impacts the interface: + // Changing the language settings impacts the interface: clear render cache _locale_invalidate_js($language->id); \Drupal::cache('render')->deleteAll(); diff --git a/core/modules/system/lib/Drupal/system/Form/PerformanceForm.php b/core/modules/system/lib/Drupal/system/Form/PerformanceForm.php index a36e9b9..eb81eba 100644 --- a/core/modules/system/lib/Drupal/system/Form/PerformanceForm.php +++ b/core/modules/system/lib/Drupal/system/Form/PerformanceForm.php @@ -18,7 +18,7 @@ class PerformanceForm extends ConfigFormBase { /** - * The page cache object. + * The render cache object. * * @var \Drupal\Core\Cache\CacheBackendInterface */ @@ -146,7 +146,8 @@ public function submitForm(array &$form, array &$form_state) { drupal_clear_css_cache(); drupal_clear_js_cache(); // This form allows page compression settings to be changed, which can - // invalidate the page cache, so it needs to be cleared on form submit. + // invalidate cached pages in the render cache, so it needs to be cleared on + // form submit. $this->renderCache->deleteAll(); $this->configFactory->get('system.performance') diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/cache/CachePluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/cache/CachePluginBase.php index ec79639..5c4a0eb 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/cache/CachePluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/cache/CachePluginBase.php @@ -32,10 +32,10 @@ var $storage = array(); /** - * Which cache bin to store the rendered output in. + * Which cache bin to store the rendered output in. * * @var string - */ + */ protected $outputBin = 'render'; /** diff --git a/core/modules/views/views.module b/core/modules/views/views.module index ba07bdf..5c2c166 100644 --- a/core/modules/views/views.module +++ b/core/modules/views/views.module @@ -525,7 +525,7 @@ function views_language_list($field = 'name', $flags = Language::STATE_ALL) { * Implements hook_ENTITY_TYPE_update() for 'field_instance_config'. */ function views_field_instance_config_update(FieldInstanceConfigInterface $field_instance) { - // @todo: Is this necessary? + // @todo: Is this necessary? Use cache tags to only delete Views' cache data? \Drupal::cache('data')->deleteAll(); \Drupal::cache('render')->deleteAll(); } @@ -534,7 +534,7 @@ function views_field_instance_config_update(FieldInstanceConfigInterface $field_ * Implements hook_ENTITY_TYPE_delete() for 'field_instance_config'. */ function views_field_instance_config_delete(FieldInstanceConfigInterface $field_instance) { - // @todo: Is this necessary? + // @todo: Is this necessary? Use cache tags to only delete Views' cache data? \Drupal::cache('data')->deleteAll(); \Drupal::cache('render')->deleteAll(); } @@ -543,7 +543,8 @@ function views_field_instance_config_delete(FieldInstanceConfigInterface $field_ * Invalidate the views cache, forcing a rebuild on the next grab of table data. */ function views_invalidate_cache() { - // Clear the views cache. + // Clear Views' info cache entries. + // @todo: Use cache tags? \Drupal::cache('data')->deleteAll(); // Clear the page and block cache.