Not sure if this is related to #2248223: Adding a new Views filter and making it exposed returns user back to list of filters, but does sound similar.

I added three sorts to a view, and one of them was for a field that's a content reference. The other sort fields were an "authored by" field and an integer field on the node.

I checked off all three in the sorts dialog before clicking okay, got presented with the settings for the "Authored by" sort first, just clicked ok.

On the content reference field, I also clicked ok, but was sent back to the same overlay for the same field, but now suddenly the "expose this filter" option was checked. I unchecked it, and clicked "ok" and was sent back to it again with it unchecked. Each time I clicked "ok", the next time I saw the overlay it was for the same field but the checkbox for whether or not it was exposed would alternate. So, first time, it was unchecked, then I clicked OK, then it was checked, then I clicked okay, and it was unchecked.

Really bizarre. The workaround for now is just close the overlay and then go in and configure the sorts one-by-one.

Comments

GuyPaddock’s picture

Just got the same loop for the filters overlay...

nod_’s picture

Title: Endless loop of overlays when adding multiple sorts to a view » Endless loop of modals when adding multiple sorts to a view
Issue tags: +JavaScript

Let's just change the terminology, "overlay" is a very loaded term and "modal" is more accurate :)

GuyPaddock’s picture

Agreed. Thanks.

dawehner’s picture

Priority: Normal » Major

Urgs, I'd consider this as major, at least.

olli’s picture

I think this is the same problem as in #2248223: Adding a new Views filter and making it exposed returns user back to list of filters. Did you try if that patch helps?

olli’s picture

Title: Endless loop of modals when adding multiple sorts to a view » Endless loop of modals when adding multiple sorts/filters to a view
Related issues: +#2500723: Ajax dialog triggers click before mouseup

Closed #2473817: Can't configure two or more filters or sort as a duplicate.

I think the problem is that this code in (ViewUI::getStandardButtons()) does not work properly with the JS (binds mouseup) and #ajax (that triggers on mousedown):

      if (isset($names)) {
        $form['actions']['submit']['#values'] = $names;
        $form['actions']['submit']['#process'] = array_merge(array('views_ui_form_button_was_clicked'), \Drupal::service('element_info')->getInfoProperty($form['actions']['submit']['#type'], '#process', array()));
      }

#2248223: Adding a new Views filter and making it exposed returns user back to list of filters removes #ajax and changes dialog.ajax.js so that it works again. Any other ideas?

Lendude’s picture

Status: Active » Closed (duplicate)

tested this with #2248223: Adding a new Views filter and making it exposed returns user back to list of filters applied and this issue is fixed by that too. Closing this as duplicate.