From 47e1bca86827d7a349dde81314495bd859c41347 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Fri, 12 Jul 2024 17:24:24 +0200 Subject: [PATCH] fix(View): column might be saved as null Signed-off-by: Arthur Schiwon --- lib/Db/View.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/Db/View.php b/lib/Db/View.php index b3177321e..69c519e44 100644 --- a/lib/Db/View.php +++ b/lib/Db/View.php @@ -89,7 +89,17 @@ public function getSortArray(): array { * @return list> */ public function getFilterArray():array { - return $this->getArray($this->getFilter()); + $filters = $this->getArray($this->getFilter()); + // a filter(group) was stored with a not-selected column - it may break impressively. + // filter them out now until we have a permanent fix + foreach ($filters as &$filterGroups) { + $filterGroups = array_filter($filterGroups, function (array $item) { + return $item['columnId'] !== null; + }); + } + return array_filter($filters, function (array $item) { + return !empty($item); + }); } private function getArray(?string $json): array {