Resetting an entity browser exposed filters loads the upload tab

Created on 25 January 2018, over 7 years ago
Updated 7 June 2023, almost 2 years ago

If you follow the standard steps to have an entity browser with two tabs which are
1. an upload widget and
2. a view to select entities

If you have a reset option on the exposed filters when you click on it to reset the view it instead loads the upload tab. I'd expect the reset button to simply reset the view.

🐛 Bug report
Status

Needs work

Version

2.0

Component

Selection display plugins

Created by

🇬🇧United Kingdom vaccinemedia

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

Comments & Activities

Not all content is available!

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

  • 🇪🇸Spain plopesc Valladolid

    Hello,

    I've been digging into this one and it seems that $form_state->getTriggeringElement() is not returning the Reset button, but the tab selector button added in WidgetSelectorBase::getForm().

    Apparently, when clicking on the "Reset" button, the form being submitted is the parent one and to the views exposed one.

    I have the feeling that will be necessary to add some JS in entity_browser.view.js to capture the Reset button event and proceed accordingly.

    Another option would be to load the view in EntityBrowserForm::submitForm() and compare the button value with the value stored in the view. However, that would open the door to inconsistencies with other modules like BEF or custom exposed form plugins.

    What do you think?

  • 🇵🇱Poland Pawelgorski87

    Morning,
    I had 2 tabs, and reset button always setup 1st one after reload page/alax.
    Patch #9 https://www.drupal.org/files/issues/2020-01-28/entity_browser-fix-for-re...
    works in my case.
    Thank you. Drupal 10.4.6 PHP 8.3.16

Production build 0.71.5 2024