- Issue created by @dieterholvoet
- Status changed to Needs review
10 months ago 11:22am 14 March 2024 - last update
10 months ago 11 pass
On one of my sites, I encountered an issue where all pages became uncacheable because an editor added a menu item referencing a non-existing (or maybe existing, but deleted) node. The problem is that Drupal\Core\Access\AccessManager::checkNamedRoute()
marks the response as uncacheable if a ParamNotConvertedException
is thrown:
Uncacheable because conversion of the parameter may not have been possible due to dynamic circumstances.
entity:node/<nid>
, and is a non-existing node id.drupal_menu
Twig functionx-drupal-dynamic-cache: UNCACHEABLE
response header.Add a new placeholder
parameter to drupal_menu
, which will make sure the menu is placeholdered, fixing dynamic page cache. More information about placeholdering can be found in this blog post.
Needs review
3.3
Code