Problem/Motivation
We are meeting 2 issues related to ViewRows source since the merge of #3542796: Preview of view sources:
commit 4017275e9afd56edc1dc88731d903f21dbca449d
Date: Tue Sep 1 08:19:28 2026 +0000
feat: #3542796 Preview of view sources
While editing the view entity
I pick Component ViewStyle plugin from UI Patterns, i select my SDC, and i add ViewsRows to a slot:

I submit the modal:
Uncaught PHP Exception Drupal\Component\Plugin\Exception\ContextException: "The display context is not a valid context." at /var/www/html/web/core/lib/Drupal/Core/Plugin/ContextAwarePluginTrait.php
The ViewsRows has not been added to the slot.
While displaying the view entity
If I have already a View with ViewRows source in a ViewStyle plug, Infinite loops are created during the render (at least the "real" one, maybe also the preview one, to check):
Fatal error: Maximum call stack size of 2048000 bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached during compilation. Try splitting expression in vendor/justinrainbow/json-schema/src/JsonSchema/Exception/InvalidArgumentException.php on line 3
It looks similar to #3620678: Infinite recursion / fatal error rendering the front-end page when main_page_content is nested inside a component's slot but it is not sure yet it is the exact same problem because it didn't appears at the exact same commit.
| Comment | File | Size | Author |
|---|
Issue fork display_builder-3620706
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
pdureau commentedI have updated the description with more details.
Still investigating to narrow the issue.
Comment #3
just_like_good_vibesguys, a quick analysis, in display_builder you need the "rows" but styled by the views style plugin, whereas the "views_rows" source of ui patterns, returns the raw views rows, before application of the style.
in the current codebase, you overwrite the ui patterns views rows source, where in fact, two sources should co-exist maybe?
before the bug, you were receiving the views rows, already styled, in the preprocess.
Comment #4
mogtofu33 commentedComment #5
mogtofu33 commentedComment #7
mogtofu33 commentedComment #8
pdureau commentedLet's explore this idea:
So, we are maybe mixing 2 different things here... do we need 2 different plugins?
To make the new plugin not available as a source of UI Patterns View Style plugin, we can play with the contexts. Today, we have this:
ui_patterns_views:plugin:option(any)ui_patterns_views:plugin:display_handler(any)ui_patterns_views:rows(any)ui_patterns_views:view_entity(entity:view)ui_patterns_views:view(any)views:styledisplay(string)ui_patterns_views:rows(any)ui_patterns_views:view_entity(entity:view)views:styleWhat can we do?
EDIT: it took me half an hour to write the comment and I didn't see the ticket was already in review 😉
Comment #9
just_like_good_vibesHello, thank you for this fix, but for me, it may not solve the root cause.
honestly, when i look at our problem, my favorite solution is that one :
- We add a new context requirement key called "views" (i.e. not views:rows, not views:style). This new context requirement key will be used by display builder, to indicate a views render context. You would inject that context requirement instead of the currently injected "views:style" (cf.
return RequirementsContext::addToContext(['views:style'], $contexts);in\Drupal\display_builder_views\Plugin\display_builder\Buildable\ViewDisplay)- We create right now in ui_patterns, all the appropriate views sources like you guys did. This will allow to create any view rendering using ui_patterns thanks to the newly context requirement "views". Of course most of the credit for the source code of those sources will be attributed to their original authors.
- We end up in display builder just using those sources (or deriving and swapping them if you need more features).
We will end up for a better couple ui_patterns + display_builder.
I created the issue #3620748: Add a views context and related sources.
Comment #10
just_like_good_vibesComment #11
just_like_good_vibesComment #13
just_like_good_vibesi pushed the code for #3620748: Add a views context and related sources and everything seems ok.
the corresponding counterpart work on display_builder is here in a second branch (but the pipeline can't success here until ui_patterns issue is merged)
Comment #14
mogtofu33 commentedI like the UI Patterns approach, added little fix on the new MR for arguments.
Comment #16
mogtofu33 commented