Needs work
Project:
Entity Browser
Version:
8.x-2.x-dev
Component:
Selection display plugins
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Jan 2018 at 14:46 UTC
Updated:
4 Jun 2025 at 12:33 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
samuel.mortensonComment #3
johnpitcairn commentedReproducible here. Rats.
Comment #4
Weilinggu commentedNoticed that this only happens in Tabs widget selector. Added a check so when user click reset, it wouldn't trigger tab switching.
Logic: If form_state has "op" input, it means it's coming from view, there is no reason to trigger submit in Tabs.php
Comment #5
Weilinggu commentedComment #6
marie.pinet commentedHi,
I have a same problem in my project.
I have "2 types" of entity browser :
Without this patch, when I click on the reset button :
With this patch, when I click on the reset button :
When I make a breakpoint in the submit function patched, I can see that the trigger element is bad.
For examples :
But I don't have find where is the problem.
Thanks for your help.
Marie
Comment #7
hawkeye.twolfNew patch attached to fix issues caused by the previous patch when the Views widget was not first in the list of tabs.
Comment #8
maximpodorov commentedReset button can have translated or even modified label.
Comment #9
maximpodorov commentedThis patch adds checking against the translated "Reset" string.
Comment #10
fernly commentedPatches not working against the stable 8.x-2.4 release.
Comment #11
teknorahSuccessfully applied patch against 8.x-2.5 & 8.x-2.6 release.
Can we get this in the next release, please?
Comment #12
nicolas bouteille commentedWorks for us too on 8.x-2.6 with modal + single widget. Thanks for the patch!
+1 RTBC
Comment #13
berdirThe reset button string is configurable, getTriggeringElement() might allow to identify that more easily?
Comment #14
berdirComment #15
plopescHello,
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 inWidgetSelectorBase::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.jsto 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?
Comment #16
pawelgorski87 commentedMorning,
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
Comment #17
kumkum29 commentedHello,
As mentioned by pawelgorski87, on Drupal 10.4.6 / PHP 8.2.27, when I click the reset button, I am redirected to the second tab.
With patch #9, this undesired behavior is resolved.
Do you plan to include this patch in the next version of the module? (I can't patch a website in production.)