Problem/Motivation

Prevent selection reset if filters haven't changed or order of them has been changed.

Steps to reproduce

Consider scenario, when user will visit page without any filters specified in URL. Select few rows. Then, filter view, but without changes in filters (I know that it can make no sense, but... it's possible via UI and may result selection reset). Default values of filters are added to the URL. VBO treats that as change in filters and reset selection.

Consider another scenario. You have URL like /content?filterA=1&filterB=2. Now change order of filters to /content?filterB=2&filterA=1. VBO comares old_filters === new_filters, filters won't be the same and as result selection will be reset.

Proposed resolution

Add default values of filters to VBO selection state and sort filters by filter name.

Comments

gugalamaciek created an issue. See original summary.

gugalamaciek’s picture

graber’s picture

Status: Active » Needs review
StatusFileSize
new2.37 KB

Re-rolled.

Please test with the latest dev..

Not sure about this line, as values from exposed_raw_input will replace those returned by the getExposedInput() method:
$exposed_input = array_merge($this->view->getExposedInput(), $this->view->exposed_raw_input);

  • Graber committed d00023a on 8.x-3.x authored by gugalamaciek
    Issue #3187079 by gugalamaciek, Graber: Prevent selection reset if...
graber’s picture

Status: Needs review » Fixed

Tested this a bit, not sure if we need to use $this->view->getExposedInput() instead of only the $this->view->exposed_raw_input as the latter contains values that are already processed like autocomplete target_id values (yes, the name of the property is misleading)..

Anyway, all works fine so.. thanks!

Status: Fixed » Closed (fixed)

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