From 680188344bfe22c7ee31732900f321d3e177aeb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Wr=C3=B3blewski?= Date: Mon, 18 Nov 2024 10:15:34 +0100 Subject: [PATCH] Revert initial data getters returning null --- src/DataTable.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/DataTable.php b/src/DataTable.php index bc2d9f48..e7fd7b6c 100755 --- a/src/DataTable.php +++ b/src/DataTable.php @@ -871,7 +871,12 @@ private function getInitialFiltrationData(): ?FiltrationData $data = $this->getPersistenceData(PersistenceContext::Filtration); } - return $data ?? $this->config->getDefaultFiltrationData(); + $data ??= $this->config->getDefaultFiltrationData(); + + $data ??= FiltrationData::fromDataTable($this); + $data->appendMissingFilters($this->getFilters()); + + return $data; } private function getInitialPersonalizationData(): ?PersonalizationData @@ -886,7 +891,7 @@ private function getInitialPersonalizationData(): ?PersonalizationData $data = $this->getPersistenceData(PersistenceContext::Personalization); } - return $data ?? $this->config->getDefaultPersonalizationData(); + return $data ?? $this->config->getDefaultPersonalizationData() ?? PersonalizationData::fromDataTable($this); } private function isPersistenceEnabled(PersistenceContext $context): bool