diff --git a/system/src/Grav/Common/Page/Page.php b/system/src/Grav/Common/Page/Page.php index 5e02559af..916d99aca 100644 --- a/system/src/Grav/Common/Page/Page.php +++ b/system/src/Grav/Common/Page/Page.php @@ -1424,6 +1424,7 @@ class Page if ($var !== null) { $this->modified = $var; } + return $this->modified; } diff --git a/system/src/Grav/Common/Page/Pages.php b/system/src/Grav/Common/Page/Pages.php index 52bfb7492..2dd1bbadf 100644 --- a/system/src/Grav/Common/Page/Pages.php +++ b/system/src/Grav/Common/Page/Pages.php @@ -820,6 +820,17 @@ class Pages $page->routable(false); } + // Override the modified time if modular + if ($page->template() == 'modular') { + foreach ($page->collection() as $child) { + $modified = $child->modified(); + + if ($modified > $last_modified) { + $last_modified = $modified; + } + } + } + // Override the modified and ID so that it takes the latest change into account $page->modified($last_modified); $page->id($last_modified.md5($page->filePath()));