From 53b7c95b0db4cac79a24c9291ce030e75fef6cef Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Wed, 28 Aug 2019 14:12:02 +0300 Subject: [PATCH] Flex: Improve copy logic --- system/src/Grav/Common/Page/Page.php | 2 +- system/src/Grav/Framework/Flex/FlexObject.php | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/system/src/Grav/Common/Page/Page.php b/system/src/Grav/Common/Page/Page.php index 8868e4449..a327ea5dc 100644 --- a/system/src/Grav/Common/Page/Page.php +++ b/system/src/Grav/Common/Page/Page.php @@ -2819,7 +2819,7 @@ class Page implements PageInterface /** * Gets the action. * - * @return string The Action string. + * @return string|null The Action string. */ public function getAction() { diff --git a/system/src/Grav/Framework/Flex/FlexObject.php b/system/src/Grav/Framework/Flex/FlexObject.php index d6cf7e3bb..4a316bfeb 100644 --- a/system/src/Grav/Framework/Flex/FlexObject.php +++ b/system/src/Grav/Framework/Flex/FlexObject.php @@ -591,12 +591,17 @@ class FlexObject implements FlexObjectInterface, FlexAuthorizeInterface * @return FlexObject|FlexObjectInterface */ public function createCopy(string $key = null) + { + $this->markAsCopy(); + + return $this->create($key); + } + + protected function markAsCopy() { $meta = $this->getMetaData(); $meta['copy'] = true; $this->_meta = $meta; - - return $this->create($key); } /**