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_requirements which 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.

CommentFileSizeAuthor
#8 3621600 after.png519.83 KBcsakiistvan
#8 3621600 before.png704.9 KBcsakiistvan
Command icon 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

pdureau created an issue. See original summary.

pdureau’s picture

Status: Active » Needs work

Work in progress

pdureau’s picture

Assigned: pdureau » just_like_good_vibes
Status: Needs work » Needs review

Hi Mikael,

Is it as simple as removing the context requirements and the related tests? Or do we need to replace it by another mechanism?

pdureau’s picture

Assigned: just_like_good_vibes » pdureau
Status: Needs review » Needs work

Checked with Mikael. Can be removed.

Before sending to review, to rebase and an also remove context_requirements: ['page'] and context_requirements: ['layout_discovery']

pdureau’s picture

Assigned: pdureau » Unassigned
Status: Needs work » Needs review

Both page and display_builder context requirements has been removed.

Available for review.

csakiistvan’s picture

Assigned: Unassigned » csakiistvan
csakiistvan’s picture

Assigned: csakiistvan » Unassigned
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new704.9 KB
new519.83 KB

✅ 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
  • The branch is 10 commits behind 1.0.x and needs a rebase; it rebased cleanly.
  • Pager/more options are now editable outside the builder in Views UI; the MR deletes testOutsideBuilderTheFormIsBare, so please confirm this is intended.
  • Stale comment left in ViewDisplay::getRuntimeContexts(): // 'display_builder' tells the sources they are configured in a builder.
pdureau’s picture

Assigned: Unassigned » pdureau

Thanks István.

I will address the notes before sending the ticket to Jean.

pdureau’s picture

Assigned: pdureau » mogtofu33

The branch is 10 commits behind 1.0.x and needs a rebase; it rebased cleanly.

Done

Stale comment left in ViewDisplay::getRuntimeContexts(): // 'display_builder' tells the sources they are configured in a builder.

Done.

Pager/more options are now editable outside the builder in Views UI; the MR deletes testOutsideBuilderTheFormIsBare, so please confirm this is intended.

display_builder context is checked only in ViewsBuilderSourceTrait::inBuilder() method, which was called in 2 places:

  • ViewsBuilderSourceTrait::settingsForm() to prevent Display Builder's plugin form to be displayed in other UI Patterns modules
  • More specifically on ViewMoreSource::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' ComponentDisplayExtender and 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.

mogtofu33 made their first commit to this issue’s fork.

  • mogtofu33 committed b6b266a2 on 1.0.x authored by pdureau
    task: #3621600 Remove display_builder context requirements
    
    By: pdureau...
mogtofu33’s picture

Assigned: mogtofu33 » Unassigned
Status: Reviewed & tested by the community » Fixed

Minor doc removal and little check. Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.