Skip to content

Commit

Permalink
Revert initial data getters returning null
Browse files Browse the repository at this point in the history
  • Loading branch information
Kreyu authored Nov 18, 2024
1 parent 5a55b48 commit 6801883
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/DataTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 6801883

Please sign in to comment.