There is a bug when showing a view by filtering all the items by default. Exposed filter setting was set to "Limit list to selected items" and all of the items were selected.

better_exposed_filters.theme
IF statement in Line #467:

if (array_search($key, $selected_options) === FALSE) {
... // NOT SELECTED
} else {
... // SELECTED!
}

For example, if the array is built like this:
[All] =>- Select all -
[0] =>Item 1
[1] =>Item 2
[2] =>Item 3
[3] =>Item 4
etc.

Since $selected_options = Array ( [0] => All ), there will be TWO of the selected items, by the key [All] and the key [0] within our $element_set array, which is wrong. Only [All] should be selected. I propose a quick fix for this:

INSTEAD OF:

if (array_search($key, $selected_options) === FALSE) {

USE THIS to fix this bug:

if (array_search($key, $selected_options) === FALSE || ($selected_options[0] == "All" && $key == 0)) {

This is probably not the best solution, but I wanted to point out at the issue.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jazzitup’s picture

Status: Needs review » Active

This is a better solution, but again, it may not solve a possible issue with the multiple choice:

if (array_search($key, $selected_options) === FALSE || ($selected_options[0] === "All" && $key !== "All")) {
jazzitup’s picture

Status: Active » Needs review

Status: Active » Needs review
jenlampton’s picture

Looks like there's no patch here? Rolling one for review.

@jazzitup could you please provide a more detailed description of how to reproduce the bug so that we can properly test this fix? I think this may not be an issue any more because when you check the 'Select all' checkbox, it checks all the other options for you.

Applying this patch results in no change of behavior for me.

jlockhart’s picture

Status: Needs review » Postponed (maintainer needs more info)

It appears this may not be an issue anymore. If someone is still having this issue please provide detailed steps to replicate.

Neslee Canil Pinto’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

Hi, there will be no more future development for 7.x branch. If you see this issue in 8.x, feel free to file an issue. Closing this as Closed(wont fix).