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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nrackleff created an issue. See original summary.

nrackleff’s picture

Here is a patch to pass just the wrapper element instead of the whole document.

ndrake86’s picture

FileSize
1.42 KB

Same issue w/ the checkbox widget. New patch adds the same solution but for checkbox-widget.js

ndrake86’s picture

Didn'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.

idebr’s picture

Status: Active » Needs review
b_sharpe’s picture

Status: Needs review » Reviewed & tested by the community

Works as it should and makes sense

  • borisson_ committed 5741864 on 8.x-1.x authored by ndrake86
    Issue #3074953 by nrackleff, ndrake86: link-widget.js should not pass...
borisson_’s picture

Status: Reviewed & tested by the community » Fixed

This does make sense, committed and pushed.

Status: Fixed » Closed (fixed)

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

tarik.cipix’s picture

Can you please release a new version. This behaviour context change is highly needed. It currently breaks all JS code that doesn't use .once().

mamoschli’s picture

Hi,
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

berliner’s picture