Closed (duplicate)
Project:
Drupal core
Version:
8.2.x-dev
Component:
views_ui.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
23 May 2015 at 14:02 UTC
Updated:
28 Apr 2017 at 19:30 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #1
nod_Preemptively adding to my queue.
Comment #2
droplet commentedIt seems #2489826: tabledrag is broken will fix above errors
Comment #3
joelpittetAlso this claims to fix it too... #2496501: Grouped Filters Javascript Improvements
Comment #4
olli commentedNot a proper fix but this seems to be related to ajax/once behavior. #2 didn't help.
Comment #5
droplet commented@olli is correct.
When you click add new group, old table is replaced with new table via Ajax. $(table).data() will be removed.
Downside of 2.0: #2348321: Upgrade to jQuery Once 2.x
Comment #6
joelpittet@droplet or @olli Is there an issue to fix once behaviour?
Maybe delegation is a more proper fix?
Comment #7
olli commented#6: I don't know. Patch?
Here's an alternative that checks if this.$form was replaced by ajax.
Comment #8
olli commentedAlmost identical patch in #2215857: Behaviors get attached to removed forms.
Comment #10
pcambraRan into this problem and found that in Firefox fails but Chrome works OK when adding filter groups and sort the stuff around.
Comment #11
dawehnerI'm wondering whether now that we have javascript tests we could actually leverage it.
Comment #12
cferthorneyI've rerolled #7 this against the latest 8.2.x-dev . Please let me know if this actually needs to go against 8.3.x now. No tests added, as I'm uncertain how to test this.
*edited to correct grammar*
Comment #13
droplet commentedthis isn't a fix @see #4. :)
Comment #14
cferthorneyMy bad. Rerolled against #2215857 instead.
Comment #16
michielnugter commentedI extended the test in #2717629: Add filter group for a View fails to add test coverage for this.
I ran the test without any alterations which causes the attachBehaviors to run for the form. This results in an incorrect situation, see the screenshot form the test.
When simply commenting ajax.js line 892:
Drupal.attachBehaviors(this.$form.get(0), settings);
Everything works correctly, which is testable in the UI and will make this test pass (see the different result in the screenshot).
The problem is that the behaviors are attached twice, once for the insert (replacing the form) and once for the form reference that is kept for the beforeSerialize() logic. The mentioned issue #2215857: Behaviors get attached to removed forms really seems relevant here and I think if that issue is fixed, this issue will also be fixed.
Comment #17
michielnugter commentedComment #18
michielnugter commentedTrigger test to run to make sure it fails op drupal.org as well.
Note: the test needs refinement before committing it.
Comment #21
michielnugter commentedMarking this a duplicate of #2215857: Behaviors get attached to removed forms as that fix fixes this issue as well.
Comment #22
hkirsman commented#2215857 Seems to fix this indeed but you need to rebuild cache.