When editing the 'Rewrite filter options', the help text states:
Use this field to rewrite the filter options displayed. Use the format of current_value|replacement_value, one replacement per line. For example:
0|Zero 1|One 2|Two
However, if you do actually try to use the 0|Zero
replacement, it won't be applied.
Looking through the code, the following lines in better_exposed_filters_exposed_form_plugin.inc prevent any empty values from being re-written:
if (!empty($search)) {
$rewrite[$search] = $replace;
}
The check for empty values isn't necessary, as any incorrect search values will be ignored (if (isset($rewrite[$option]))
will fail further down on line 943).
I've therefore removed the empty check, so that zero values can be replaced.
Comment | File | Size | Author |
---|---|---|---|
#1 | better_exposed_filters-rewrite-zeroes-2391843-1.patch | 726 bytes | LGLC |
Comments
Comment #1
LGLC CreditAttribution: LGLC commentedPatch attached.
Comment #3
mikeker CreditAttribution: mikeker commentedGood catch on the bug. However, we need to check that $
search
is defined before adding it to the array. Usingisset
instead ofempty
does the trick.Thanks.