Implement hook_cache_flush() in Views module to be picked up by drupal_flush_all_caches()

Created on 28 June 2023, about 1 year ago
Updated 28 July 2023, about 1 year ago

Problem/Motivation

"Flush views caches" is the submenu of main "Flush all caches" menu. But when you click "Flush all caches" button the Views cache don't flush that is really confused:

It happends because the drupal_flush_all_caches() function don't trigger views_invalidate_cache()

Steps to reproduce

To clear the cache of views uses the method views_invalidate_cache() so here the steps how to check that this method not triggers while clearing ALL site caches:

  1. Enable views module
  2. Open web/core/modules/views/views.module and set breakpoint to the views_invalidate_cache():
  3. Go to admin/config/development/performance
  4. Enable debugging and press "Clear all caches"
  5. Check that debug session was finished without being paused on views_invalidate_cache() function

Proposed resolution

Add hook_cache_flush() to views module that will be fired by drupal_flush_all_caches().

✨ Feature request
Status

Needs work

Version

11.0 πŸ”₯

Component
ViewsΒ  β†’

Last updated about 13 hours ago

Created by

πŸ‡§πŸ‡ΎBelarus fromme

Live updates comments and jobs are added and updated live.
  • views

    Involves, uses, or integrates with views. In Drupal 8 core, use the β€œVDC” tag instead.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024