Problem/Motivation
When working on #3620706: ViewRows source in a ViewStyle plugin, a display_builder context requirements has been added.
This is wrong:
- it increases our usage of
context_requirementswhich have an uncertain future. - it makes our sources dependent on a "tool" rather than on a real data context
Proposed resolution
Remove this context requirement.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 3621600 after.png | 519.83 KB | csakiistvan |
| #8 | 3621600 before.png | 704.9 KB | csakiistvan |
Issue fork display_builder-3621600
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 #3
pdureau commentedWork in progress
Comment #4
pdureau commentedHi Mikael,
Is it as simple as removing the context requirements and the related tests? Or do we need to replace it by another mechanism?
Comment #5
pdureau commentedChecked with Mikael. Can be removed.
Before sending to review, to rebase and an also remove
context_requirements: ['page']andcontext_requirements: ['layout_discovery']Comment #6
pdureau commentedBoth
pageanddisplay_buildercontext requirements has been removed.Available for review.
Comment #7
csakiistvanComment #8
csakiistvan✅ Tested and works — applied MR !387 rebased locally on current 1.0.x, rebuilt caches, and opened the view's "Component" (UI Patterns display extender) dialog with a [View] Pager source in a slot: before, the source settings were empty; after, the full pager form (Items per page, Offset, Pager ID, exposed options) is shown in Views UI. The display_builder and page context requirements are gone with no breakage observed.
Notes
testOutsideBuilderTheFormIsBare, so please confirm this is intended.ViewDisplay::getRuntimeContexts():// 'display_builder' tells the sources they are configured in a builder.Comment #9
pdureau commentedThanks István.
I will address the notes before sending the ticket to Jean.
Comment #10
pdureau commentedDone
Done.
display_buildercontext is checked only inViewsBuilderSourceTrait::inBuilder()method, which was called in 2 places:ViewsBuilderSourceTrait::settingsForm()to prevent Display Builder's plugin form to be displayed in other UI Patterns modulesViewMoreSource::settingsForm()for the same reason, because this plugin is recreating the View form instead of loading it (maybe something else to worry about.. but this is a distinct topic)I have checked in a view with UI Patterns'
ComponentDisplayExtenderand it is true I now see the plugin forms there. Changing the value from this form is not storing anything and doesn't have a any effect on how the View is rendered. So, it feels weirds, and it will be confusing, but it is not breaking stuff.We can move the View entity alteration logic to UI Patterns, for example, in a future ticket. But, for now, I would advise to not ship Display Builder with such a goofy context.
Comment #13
mogtofu33 commentedMinor doc removal and little check. Thanks!