Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
link-widget.js uses Drupal.attachBehaviors(context, Drupal.settings);
, but Drupal already calls attachBehaviors on the document, thus causing some other js to be executed twice. This is very similar to https://www.drupal.org/project/facets/issues/2851024 where the same thing happened in dropdown-widget.js. I'll post a patch here momentarily.
Comment | File | Size | Author |
---|---|---|---|
#3 | attachBehaviors_scope-3074953-3.patch | 1.42 KB | ndrake86 |
Comments
Comment #2
nrackleff CreditAttribution: nrackleff at ThinkShout commentedHere is a patch to pass just the wrapper element instead of the whole document.
Comment #3
ndrake86 CreditAttribution: ndrake86 at Workday, Inc. commentedSame issue w/ the checkbox widget. New patch adds the same solution but for checkbox-widget.js
Comment #4
ndrake86 CreditAttribution: ndrake86 at Workday, Inc. commentedDidn't get a chance to explain my scenario (in case anyone stumbles on to this). For a search API view with both an exposed filter text input box and an exposed operator (contains, not contains, empty, not empty) and a checkbox facet, the call to attachBehaviors was triggering the toggle for hidding the filter input box. The patch in #3 takes the same approach as #2.
Comment #5
idebr CreditAttribution: idebr at iO commentedComment #6
b_sharpe CreditAttribution: b_sharpe at ImageX commentedWorks as it should and makes sense
Comment #8
borisson_This does make sense, committed and pushed.
Comment #10
tarik.cipix CreditAttribution: tarik.cipix commentedCan you please release a new version. This behaviour context change is highly needed. It currently breaks all JS code that doesn't use .once().
Comment #11
mamoschli CreditAttribution: mamoschli commentedHi,
I was about to open a new issue about exactly this issue and was quite happy when I found that it is actually already resolved. But as tarik.cipix mentioned it would be great if a new version could be released fixing this bug.
Thanks
Comment #12
berliner CreditAttribution: berliner commentedThis is part of https://www.drupal.org/project/facets/releases/8.x-1.5