From 278671deeca08995ee0eabc99a767cdf1cf54fdd Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Thu, 27 May 2021 14:18:12 +0300 Subject: [PATCH] Fixed flex pages using wrong type in `onBlueprintCreated` event [#3157] --- CHANGELOG.md | 1 + system/src/Grav/Common/Flex/Types/Pages/PageObject.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8818551a4..fa9a35e65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ * Fixed `pathinfo()` twig filter in PHP7 * Fixed the first visible child page getting ordering number `999999.` [#3365](https://github.com/getgrav/grav/issues/3365) * Fixed flex pages search using only folder name [#3316](https://github.com/getgrav/grav/issues/3316) + * Fixed flex pages using wrong type in `onBlueprintCreated` event [#3157](https://github.com/getgrav/grav/issues/3157) # v1.7.15 ## 05/19/2021 diff --git a/system/src/Grav/Common/Flex/Types/Pages/PageObject.php b/system/src/Grav/Common/Flex/Types/Pages/PageObject.php index b1ec6bfa3..914eb7f33 100644 --- a/system/src/Grav/Common/Flex/Types/Pages/PageObject.php +++ b/system/src/Grav/Common/Flex/Types/Pages/PageObject.php @@ -502,6 +502,8 @@ class PageObject extends FlexPageObject if ($isNew === true && $name === '') { // Support onBlueprintCreated event just like in Pages::blueprints($template) $blueprint->set('initialized', true); + $blueprint->setFilename($template); + Grav::instance()->fireEvent('onBlueprintCreated', new Event(['blueprint' => $blueprint, 'type' => $template])); }