mirror of
https://github.com/getgrav/grav.git
synced 2025-10-26 07:56:07 +01:00
Fixed onBlueprintCreated event being called multiple times in Flex Pages
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
* Fixed cannot change image format [#3173](https://github.com/getgrav/grav/issues/3173)
|
||||
* Fixed saving page in expert mode [#3174](https://github.com/getgrav/grav/issues/3174)
|
||||
* Fixed exception in `$flexPage->frontmatter()` method when setting value
|
||||
* Fixed `onBlueprintCreated` event being called multiple times in `Flex Pages` [grav-plugin-flex-objects#97](https://github.com/trilbymedia/grav-plugin-flex-objects/issues/97)
|
||||
|
||||
# v1.7.3
|
||||
## 01/21/2021
|
||||
|
||||
@@ -65,6 +65,8 @@ class FlexObject implements FlexObjectInterface, FlexAuthorizeInterface
|
||||
private $_flexDirectory;
|
||||
/** @var FlexFormInterface[] */
|
||||
private $_forms = [];
|
||||
/** @var Blueprint|null */
|
||||
private $_blueprint;
|
||||
/** @var array */
|
||||
private $_meta;
|
||||
/** @var array */
|
||||
@@ -769,11 +771,15 @@ class FlexObject implements FlexObjectInterface, FlexAuthorizeInterface
|
||||
*/
|
||||
public function getBlueprint(string $name = '')
|
||||
{
|
||||
$blueprint = $this->doGetBlueprint($name);
|
||||
$blueprint->setScope('object');
|
||||
$blueprint->setObject($this);
|
||||
if (null === $this->_blueprint) {
|
||||
$blueprint = $this->doGetBlueprint($name);
|
||||
$blueprint->setScope('object');
|
||||
$blueprint->setObject($this);
|
||||
|
||||
return $blueprint->init();
|
||||
$this->_blueprint = $blueprint->init();
|
||||
}
|
||||
|
||||
return $this->_blueprint;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user