Provide hook to alter view executable before render in view widget

Created on 10 March 2019, over 5 years ago
Updated 3 September 2024, 3 months ago

Problem/Motivation

There is no easy way to alter the view before render from the entity browser. While there are various view alter hooks, they do not have the contextual information from the entity browser.

Proposed resolution

Add an alter hook to alter the view executable before rendering the view within /src/Plugin/EntityBrowser/Widget/View.php.

Remaining tasks

- Review
- Changes?
- Add test

User interface changes

- None

API changes

- adds optional alter hook (api information to entity_browser.api.php)

Data model changes

- None

✨ Feature request
Status

RTBC

Version

2.0

Component

Widget plugins

Created by

πŸ‡ΊπŸ‡ΈUnited States oknate Greater New York City Area

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
  • Merge request !42Resolve #3038854 "Provide view alter hook" β†’ (Open) created by heddn
  • Status changed to Needs review 11 months ago
  • heddn Nicaragua

    Rebased patch into an MR.

  • Pipeline finished with Failed
    11 months ago
    Total: 251s
    #69312
  • Pipeline finished with Failed
    11 months ago
    Total: 341s
    #69593
  • Pipeline finished with Failed
    11 months ago
    Total: 339s
    #69596
  • heddn Nicaragua

    Tests are mostly passing now on the MR. At least the same tests that aren't failing on HEAD are now passing. Hiding patches.

  • First commit to issue fork.
  • Pipeline finished with Success
    3 months ago
    Total: 231s
    #271882
  • Status changed to RTBC 3 months ago
  • πŸ‡§πŸ‡¬Bulgaria pfrenssen Sofia

    This is looking good to me. I tried it out and it works brilliantly. The context data provided is very complete and helpful. One gotcha was that the Views display is not retained, so switching to another display cannot be done in the normal way (by calling ViewsExecutable::setDisplay('my_display')).

    This is not a problem in practice since the widget configuration is also passed by reference in the alter hook, so it can be done by setting $configuration['view_display'] = 'my_display'.

  • Pipeline finished with Success
    3 months ago
    Total: 666s
    #272502
Production build 0.71.5 2024