diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b64a5ec7..048d99b07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,8 @@ ## mm/dd/2020 1. [](#new) - * Renamed `PageCollectionInterface::nonModular()` into `PageCollectionInterface::pages()` and deprecate the old method - * Renamed `PageCollectionInterface::modular()` into `PageCollectionInterface::modules()` and deprecate the old method + * Renamed `PageCollectionInterface::nonModular()` into `PageCollectionInterface::pages()` and deprecated the old method + * Renamed `PageCollectionInterface::modular()` into `PageCollectionInterface::modules()` and deprecated the old method 1. [](#bugfix) * *Menu Visibility Requires Access* Security option setting wrong frontmatter [login#265](https://github.com/getgrav/grav-plugin-login/issues/265) * Accessing page with unsupported file extension (jpg, pdf, xsl) will use wrong mime type [#3031](https://github.com/getgrav/grav/issues/3031) diff --git a/system/src/Grav/Common/Page/Pages.php b/system/src/Grav/Common/Page/Pages.php index a89178532..e885dedf3 100644 --- a/system/src/Grav/Common/Page/Pages.php +++ b/system/src/Grav/Common/Page/Pages.php @@ -631,17 +631,19 @@ class Pages } // Handle '@page', '@page.modular: false', '@self' and '@self.modular: false'. - if (null === $type || ($type === 'modular' && ($params[0] ?? null) === false)) { + if (null === $type || (in_array($type, ['modular', 'modules']) && ($params[0] ?? null) === false)) { $type = 'children'; } switch ($type) { case 'all': return $page->children(); + case 'modules': case 'modular': - return $page->children()->modular(); + return $page->children()->modules(); + case 'pages': case 'children': - return $page->children()->nonModular(); + return $page->children()->pages(); case 'page': case 'self': return (new Collection())->addPage($page); @@ -653,7 +655,7 @@ class Pages $parent = $page->parent(); return $parent ? $parent->children()->remove($page->path()) : new Collection(); case 'descendants': - return $this->all($page)->remove($page->path())->nonModular(); + return $this->all($page)->remove($page->path())->pages(); default: // Unknown type; return empty collection. return new Collection();