Problem/Motivation
Views-based tabs loaded via AJAX are missing contextual links (the "edit view" pencil). The initial/default tab renders them correctly because its View render array passes through the normal render pipeline where contextual_preprocess() picks up #contextual_links.
AJAX-loaded tabs don't get contextual links because ViewContent::doRender() eagerly renders the View with renderRoot() and returns #markup. By the time the render array reaches the template layer, it's flat HTML and contextual_preprocess() never sees the #contextual_links.
Steps to reproduce
- Create a QuickTabs instance with AJAX enabled and multiple Views tabs.
- View the page as a user with "access contextual links" permission.
- The default tab shows the contextual links pencil.
- Click a secondary tab. No contextual links appear.
Proposed resolution
Add #contextual_links to the View's render array inside ViewContent::doRender(), after $view->buildRenderable() but before the renderRoot() call. This way they're part of the render array when it gets processed and survive the eager rendering on the AJAX path.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | Screenshot 2026-06-28 at 20.49.26.png | 48.13 KB | joelpittet |
| #10 | Screenshot 2026-06-28 at 20.50.05.png | 20.68 KB | joelpittet |
Issue fork quicktabs-3606793
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
loze commentedComment #3
loze commentedComment #7
loze commentedComment #8
joelpittetOh I totally want this too, thanks for taking this on love!
Comment #9
loze commentedI've updated the MR and addressed your points.
Comment #10
joelpittetThanks again @loze
Here's the manual test screenshots I did before merging.
Before:

After:
