Commit 839cbfc4 authored by Guillaume Perréal's avatar Guillaume Perréal
Browse files

Correction de la normalisation des filtres.

On perdait les clefs, ce qui rendait les filtres inopérants.
parent dc25b7e4
...@@ -80,16 +80,24 @@ class ClassFilterBuilder ...@@ -80,16 +80,24 @@ class ClassFilterBuilder
} }
if (is_array($data)) { if (is_array($data)) {
$res = []; $res = [];
$isList = true;
foreach($data as $k => $v) { foreach($data as $k => $v) {
$normalized = $this->normalize($v); $normalized = $this->normalize($v);
if (!empty($normalized)) { if (!empty($normalized)) {
$res[$k] = $normalized; $res[$k] = $normalized;
if (!is_int($k)) {
$isList = false;
}
} }
} }
if (empty($res)) { if (empty($res)) {
return null; return null;
} }
sort($res); if ($isList) {
sort($res);
} else {
ksort($res);
}
return $res; return $res;
} }
return $data; return $data;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment