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.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | views_bulk_operations-prevent-selection-reset-3187079-3.patch | 2.37 KB | graber |
| #2 | views_bulk_operations-prevent-selection-reset-3187079-2.patch | 2.71 KB | gugalamaciek |
Comments
Comment #2
gugalamaciek commentedComment #3
graber commentedRe-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);Comment #5
graber commentedTested this a bit, not sure if we need to use
$this->view->getExposedInput()instead of only the$this->view->exposed_raw_inputas 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!