Skip to content

Commit

Permalink
fix(View): column might be saved as null
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
  • Loading branch information
blizzz committed Jul 12, 2024
1 parent 6a22984 commit 8c9b58b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/Db/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,17 @@ public function getSortArray(): array {
* @return list<list<array{columnId: int, operator: 'begins-with'|'ends-with'|'contains'|'is-equal'|'is-greater-than'|'is-greater-than-or-equal'|'is-lower-than'|'is-lower-than-or-equal'|'is-empty', value: string|int|float}>>
*/
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 {
Expand Down

0 comments on commit 8c9b58b

Please sign in to comment.