From 34e50aab21b2144c0bb21e9ae93074ffa211877d Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Sat, 20 Jun 2015 11:54:46 -0600 Subject: [PATCH] remove replicated code... --- system/src/Grav/Common/Page/Pages.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/system/src/Grav/Common/Page/Pages.php b/system/src/Grav/Common/Page/Pages.php index f15808ec4..dd70501f3 100644 --- a/system/src/Grav/Common/Page/Pages.php +++ b/system/src/Grav/Common/Page/Pages.php @@ -492,11 +492,6 @@ class Pages if (!$this->instances) { $this->grav['debugger']->addMessage('Page cache missed, rebuilding pages..'); - // Fire event for memory and time consuming plugins... - if ($config->get('system.pages.events.page')) { - $this->grav->fireEvent('onBuildPagesInitialized'); - } - $this->recurse($pagesDir); $this->buildRoutes(); @@ -511,11 +506,6 @@ class Pages $taxonomy->taxonomy($taxonomy_map); } } else { - // Fire event for memory and time consuming plugins... - if ($config->get('system.pages.events.page')) { - $this->grav->fireEvent('onBuildPagesInitialized'); - } - $this->recurse($pagesDir); $this->buildRoutes(); } @@ -539,6 +529,11 @@ class Pages /** @var Config $config */ $config = $this->grav['config']; + // Fire event for memory and time consuming plugins... + if ($parent === null && $config->get('system.pages.events.page')) { + $this->grav->fireEvent('onBuildPagesInitialized'); + } + $page->path($directory); if ($parent) { $page->parent($parent);