Filter groups adding and removing does not work.

Steps to reproduce

  • Edit a View.
  • Add at least two filters.
  • Click on "Add/Or Rearrange".
  • Click on "Create new filter group".
  • On Version 8.2.2 nothing happens.
  • On Version 8.2.4 the new filter group appears in the form.
  • Move one filter to the new filter group and save the form.
  • Nothing has been saved.
  • If you go back to the form "Add/Or Rearrange", the form is reset.

On 8.2.4, no Javascript or PHP error appears.

CommentFileSizeAuthor
#7 views_create_filter_group.gif240.06 KBdmsmidt

Comments

handkerchief created an issue. See original summary.

handkerchief’s picture

Title: New filter group are not saved » New filter groups are not saved
handkerchief’s picture

lendude’s picture

Component: views.module » views_ui.module
Status: Active » Postponed (maintainer needs more info)
Issue tags: -ajax callback, -views filters

The change from 8.2.2 to 8.2.4 is because #2717629: Add filter group for a View fails was fixed.

This feels like it might be a duplicate of #2825446: Moving a filter to the end of a Filter group in filter rearrange doesn't work but does allow dropping in invalid regions but the steps are a little different, @handkerchief do you think these are two different issues?

I tried to reproduce the issue described here but couldn't using the steps given. Am I missing a vital step? I used an existing View, should it be a new fresh one?

handkerchief’s picture

Hm.. good question. Indeed, it can be the same cause. But the issue #2825446 has already two filter groups. And I can not create a second filtergroup, so i think my problem starts earlier.

  • I have also tested it with https://simplytest.me/. (only Drupal Core 8.2.4)
  • The problem exists in every view, new or existing. For example with the default content list view from the core.


  1. Create a fresh drupal core 8.2.4 project with https://simplytest.me/
  2. Go to the content view and try to add a second filter group.
  3. Move a filter inside the new group and click on save.

what is your result?

lendude’s picture

@handkerchief oh yeah, it's indeed broken on a fresh install. What I think we're seeing is a combination of #2215857: Behaviors get attached to removed forms and #2825446: Moving a filter to the end of a Filter group in filter rearrange doesn't work but does allow dropping in invalid regions.
If I move the filter UNDER the new group (so not in it, so into an invalid position really), it gets saved to the new group.

If I then move it back to the first filter group and save, it stays in the second group. If I move it to the first group and then remove the second group and then save, moving it works.

If I switch off the drag and drop features by clicking 'Show row weights', everything works fine from start to finish.

Haven't tested it with any of the available patches in the other issues, but that might be worth doing to see if that solves all this.

dmsmidt’s picture

Version: 8.2.x-dev » 8.4.x-dev
Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (outdated)
StatusFileSize
new240.06 KB

I can confirm that in 8.4.x you can create new filters.
However the Drag and Drop behavior is somewhat broken. But this will be addressed in earlier mentioned issues.