Menu blocks don't render on preview pages

Created on 18 February 2025, about 2 months ago

Problem/Motivation

So we are seeing an issue where menu blocks don't appear to render on preview link pages. This seems to be acknowledged as an issue in #3158706: Access check is breaking caches of unrelated routes β†’

"This is causing things like menu blocks to placeholder but never render."

My users want to be able to see the menu blocks as they are prominent on some pages. How can we render these? I recognize that others might not want to due to performance reasons, but I was asked to look into this. I tried it with the "canonical_reroute" patch and option in πŸ› Canonical reroute behavior is confusing & feels unnecessary in many situations Needs work , but that didn't seem to work for me.

I'm surprised this didn't already have an issue filed for it, so I'm wondering if I am overlooking some other setting. Any suggestions?

πŸ’¬ Support request
Status

Active

Version

2.2

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States bburg Washington D.C.

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

Comments & Activities

  • Issue created by @bburg
  • Hi, if you talking about menu breadcrum like "home/somepage/someotherpage/" not being rendered, then I am having the same issue. In code, it looks like the array that holds menu items is empty in preview link pages. Not sure what went wrong but hopefully someone can answer.

  • πŸ‡ΊπŸ‡ΈUnited States bburg Washington D.C.

    I'm talking specifically about the block provided by the Menu Block β†’ module. But now that you mention it, the breadcrumb isn't showing correctly on the page I'm looking at either. I assume this have a similar root issue, where these systems, where internally, Drupal doesn't recognize the Preview Link path as the canonical path for the page, so it renders the menu block, and the breadcrumb as if it weren't.

    I've been poking at this most of the morning, and didn't really get anywhere on it. Perhaps someone who has a more in-depth knowledge of the routing and menu trail systems can chime in.

Production build 0.71.5 2024