Move menu_ui_menu_* entity hook implementations to the Menu entity

Created on 4 July 2018, over 6 years ago
Updated 12 September 2023, about 1 year ago

Problem/Motivation

The Menu UI module implements several entity hooks for the Menu entity. But actually these hook implementations are clearing caches that need to be cleared even if the Menu UI module is not enabled.

The easiest way to see this is to install the minimal profile from a configuration export (as this does not have the Menu UI module installed):

  1. Install the minimal profile
  2. Make some configuration changes - for example the site name
  3. Use drush config-export to export your configuration to the sync directory
  4. drop your database and re-create an empty on with the same name
  5. Visit your site - you'll be taken to the installer and on the profile select screen you will be able to choose "Use existing configuration"

The menus will be broken.

Proposed resolution

Move the hook implementations into the Menu entity.

Remaining tasks

User interface changes

None

API changes

menu_cache_clear_all() is deprecated in this issue as these are the only calls in core. The replacement is to call \Drupal::cache('menu')->invalidateAll(); directly.

Data model changes

None

πŸ› Bug report
Status

Fixed

Version

8.6 ⚰️

Component
ConfigurationΒ  β†’

Last updated 1 day ago

Created by

πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024