If menu link content entities are in the menu then they should also be in the cache tags

Created on 29 May 2025, 7 days ago

Problem/Motivation

If a menu link content entity is part of the menu then it should be in the cache tags.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

1.2

Component

Code

Created by

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

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

Comments & Activities

  • Issue created by @alexpott
  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

    This might not actually be an issue because \Drupal\menu_link_content\Entity\MenuLinkContent::postSave() will result in clearing the cache tags of the affect menus.

    See \Drupal\Core\Menu\MenuTreeStorage::save()

        $cache_tags = Cache::buildTags('config:system.menu', $affected_menus, '.');
        $this->cacheTagsInvalidator->invalidateTags($cache_tags);
    

    Going to close this one because adding the cache tags for each entity feels like noise.

Production build 0.71.5 2024