Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable0.7] fix(View): column might be saved as null #1229

Merged
merged 1 commit into from
Jul 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion lib/Db/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,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
Loading