Skip to content

Commit

Permalink
Fix cache invalidation check on pages without publishDate and `unpu…
Browse files Browse the repository at this point in the history
…blishDate` fields
  • Loading branch information
giuscris committed Nov 3, 2024
1 parent ec3c77b commit ee1be69
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion formwork/src/Controllers/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function load(RouteParams $routeParams, Statistics $statistics): Response
return $this->getPageResponse($this->site->errorPage());
}

if ($this->config->get('system.cache.enabled') && ($page->has('publishDate') || $page->has('unpublishDate')) && (
if ($this->config->get('system.cache.enabled') && ($page->fields()->has('publishDate') || $page->fields()->has('unpublishDate')) && (
($page->isPublished() && !$page->publishDate()->isEmpty() && !$this->site->modifiedSince($page->publishDate()->toTimestamp()))
|| (!$page->isPublished() && !$page->unpublishDate()->isEmpty() && !$this->site->modifiedSince($page->unpublishDate()->toTimestamp()))
)) {
Expand Down

0 comments on commit ee1be69

Please sign in to comment.