Skip to content

Commit

Permalink
Fix missing option in new multiselect field
Browse files Browse the repository at this point in the history
  • Loading branch information
dasistwas committed Jan 12, 2025
1 parent ca707fb commit def55ed
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 12 deletions.
10 changes: 0 additions & 10 deletions field/field_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -949,15 +949,6 @@ public function set_field($forminput = null) {
}
}

// NOTE: We don't use this code ever, test till 30.04.2021 and remove after.
if ($this->field->type != "multiselect") {
$dummyentry = "0";
while (array_search($dummyentry, $newvalues) !== false) {
$dummyentry .= "0";
}
$newvalues = array_merge(array(0 => $dummyentry), $newvalues);
}

$map = array(0 => 0);
for ($i = 1; $i <= count($oldvalues); $i++) {
$j = array_search($oldvalues[$i], $newvalues);
Expand Down Expand Up @@ -985,7 +976,6 @@ public function set_field($forminput = null) {
$this->update_options($map);
}

unset($newvalues[0]);
$this->field->param1 = implode("\n", $newvalues);
for ($i = 2; $i <= 10; $i++) {
$param = "param$i";
Expand Down
2 changes: 1 addition & 1 deletion filter/filter_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ public function get_filter_from_id($filterid = 0, array $options = null) {
$view = !empty($options['view']) ? $options['view'] : null;
$viewid = $view ? $view->id() : 0;
$advanced = !empty($options['advanced']);
$customfilter = $options['customfilter'];
$customfilter = !empty($options['customfilter']) ? $options['customfilter'] : null;

// User preferences.
if (($filterid == self::USER_FILTER_SET || $advanced || $customfilter) && $view && $view->is_active()) {
Expand Down
1 change: 0 additions & 1 deletion tests/behat/customfilter_multiselect.feature
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ Feature: Create entry, add multiselect and use customfilter
And I should not see "Opt5"

# Use customfilter to select Opt1 OR Opt2.
When I follow "Search"
And I open the autocomplete suggestions list
And I click on "Opt1" item in the autocomplete list
And I close the autocomplete suggestions list
Expand Down

0 comments on commit def55ed

Please sign in to comment.