Standardize an efficient way to load data keyed by route name and parameters

Created on 12 July 2014, over 10 years ago
Updated 28 August 2024, 4 months ago

Follow-up to #2256497: [meta] Menu Links - New Plan for the Homestretch

Problem/Motivation

In the menu link system and other places we may want to associate data with a specific route name AND route parameters e.g. data associated with 'node.view' and node => 1

In Drupal 7, this would be a certain system path, but in Drupal 8, we want to adhere to the priciple that the system path may be altered by altering the route path without changing the relationship to the route name and parameters.

So, the system path is NOT the right answer. Instead one could use the route name and some serialization of the route parameters in a ingle text field.

Proposed resolution

Remaining tasks

User interface changes

API changes

📌 Task
Status

Needs work

Version

11.0 🔥

Component
Menu system 

Last updated about 10 hours ago

Created by

🇺🇸United States pwolanin

Live updates comments and jobs are added and updated live.
  • API change

    Changes an existing API or subsystem. Not backportable to earlier major versions, unless absolutely required to fix a critical bug.

  • Needs architectural review

    The issue is available for high level reviews only. If there is a patch or MR it is not to be set to 'Needs work' for coding standards, minor or nit-pick changes.

  • D8MI

    (Drupal 8 Multilingual Initiative) is the tag used by the multilingual initiative to mark core issues (and some contributed module issues). For versions other than Drupal 8, use the i18n (Internationalization) tag on issues which involve or affect multilingual / multinational support. That is preferred over Translation.

  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

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

  • 🇮🇳India rassoni Bangalore

    Rerolling patch from comment 30
    Fixed PHPCS and Deperactred code.

  • 🇮🇳India rassoni Bangalore

    Fixed Command Failed.

  • 🇮🇳India rassoni Bangalore

    Forgot to attach interdiff

  • Status changed to Needs work almost 2 years ago
  • 🇬🇧United Kingdom catch

    Don't think we can use a persistent cache here, or at least not without adding the relevant cache tags to it.

    The original approach here was to add a static cache, 🌱 [policy] Standardize how we implement in-memory caches Needs work has a way to do that without using drupal_static().

    Could use an issue summary update. This is also likely cached at a higher level now like the render cache, so we'd want to check if this data is actually requested more than once on the same request (for example after a cache clear).

  • 🇺🇸United States djdevin Philadelphia

    Seems to still be called a lot, even with a warm cache. Looking at RDS insights it's still a top query under load.

    General log is full of the same query, even when trying the page as anon (no page cache, just dynamic cache).

    (346 is the current node being viewed)

    Could be something with our site but still investigating.

  • 🇺🇸United States djdevin Philadelphia

    Patch worked once rerolled for 10.3.x, not flooding the query log anymore.

    There's a tag set on config:system.menu.[name], not sure if that gets flushed if a link changes.

  • Merge request !9360Issue #2302139: add cache to load by route → (Open) created by djdevin
Production build 0.71.5 2024