mirror of
https://github.com/cosmocode/dokuwiki-plugin-struct.git
synced 2026-01-09 14:15:26 +00:00
fix numeric values in filter control. #665
This commit is contained in:
@ -79,7 +79,18 @@ class AggregationFilter extends Aggregation
|
||||
// create an array with [value => displayValue] pairs
|
||||
// the cast to array will handle single and multi-value fields the same
|
||||
// using the full value as key will make sure we don't have duplicates
|
||||
$pairs = array_combine((array)$value->getValue(), (array)$value->getDisplayValue());
|
||||
//
|
||||
// because a value might be interpreted as integer in the array key, we pad
|
||||
// each key with a space at the end to enforce string keys. The space will
|
||||
// be ignored when parsing JSON values and trimmed for all other types.
|
||||
// This is a work around for #665
|
||||
$pairs = array_combine(
|
||||
array_map(
|
||||
static fn($v) => "$v ",
|
||||
(array)$value->getValue()
|
||||
),
|
||||
(array)$value->getDisplayValue()
|
||||
);
|
||||
$colValues[$colName]['values'] = array_merge($colValues[$colName]['values'], $pairs);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user