mirror of
https://github.com/getgrav/grav.git
synced 2026-02-03 21:30:24 +01:00
Moved logic into page recurse where pages are already recursed and use collection()
This commit is contained in:
@@ -1425,16 +1425,6 @@ class Page
|
||||
$this->modified = $var;
|
||||
}
|
||||
|
||||
if ($this->template == 'modular') {
|
||||
foreach ($this->children() as $child) {
|
||||
$modified = $child->modified();
|
||||
|
||||
if ($modified > $this->modified) {
|
||||
$this->modified = $modified;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $this->modified;
|
||||
}
|
||||
|
||||
|
||||
@@ -790,6 +790,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()));
|
||||
|
||||
Reference in New Issue
Block a user