From 2fbca18b486ccc7a30795703de4bc9f585c6fff4 Mon Sep 17 00:00:00 2001 From: Benjamin Klix Date: Wed, 6 Nov 2024 07:24:50 +0100 Subject: [PATCH] BUGFIX: Add missing event emitters to internal node properties --- .../Classes/Domain/Model/Node.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Neos.ContentRepository/Classes/Domain/Model/Node.php b/Neos.ContentRepository/Classes/Domain/Model/Node.php index 6f6b0df8882..14f94b41aa1 100644 --- a/Neos.ContentRepository/Classes/Domain/Model/Node.php +++ b/Neos.ContentRepository/Classes/Domain/Model/Node.php @@ -1,4 +1,5 @@ materializeNodeData(); } - if ((boolean)$removed === true) { + if ((bool)$removed === true) { /** @var $childNode Node */ foreach ($this->getChildNodes() as $childNode) { $childNode->setRemoved(true); @@ -1389,10 +1390,13 @@ public function setHidden($hidden): void if ($this->isHidden() === $hidden) { return; } + $oldValue = $this->isHidden(); + $this->emitBeforeNodePropertyChange($this, '_hidden', $oldValue, $hidden); $this->materializeNodeDataAsNeeded(); $this->nodeData->setHidden($hidden); $this->context->getFirstLevelNodeCache()->flush(); + $this->emitNodePropertyChanged($this, '_hidden', $oldValue, $hidden); $this->emitNodeUpdated($this); } @@ -1421,10 +1425,13 @@ public function setHiddenBeforeDateTime(\DateTimeInterface $dateTime = null): vo if ($this->getHiddenBeforeDateTime() instanceof \DateTime && $dateTime instanceof \DateTime && $this->getHiddenBeforeDateTime()->format(\DateTime::W3C) === $dateTime->format(\DateTime::W3C)) { return; } + $oldValue = $this->getHiddenBeforeDateTime(); + $this->emitBeforeNodePropertyChange($this, '_hiddenBeforeDateTime', $oldValue, $dateTime); $this->materializeNodeDataAsNeeded(); $this->nodeData->setHiddenBeforeDateTime($dateTime); $this->context->getFirstLevelNodeCache()->flush(); + $this->emitNodePropertyChanged($this, '_hiddenBeforeDateTime', $oldValue, $dateTime); $this->emitNodeUpdated($this); } @@ -1452,10 +1459,13 @@ public function setHiddenAfterDateTime(\DateTimeInterface $dateTime = null): voi if ($this->getHiddenAfterDateTime() instanceof \DateTimeInterface && $dateTime instanceof \DateTimeInterface && $this->getHiddenAfterDateTime()->format(\DateTime::W3C) === $dateTime->format(\DateTime::W3C)) { return; } + $oldValue = $this->getHiddenAfterDateTime(); + $this->emitBeforeNodePropertyChange($this, '_hiddenAfterDateTime', $oldValue, $dateTime); $this->materializeNodeDataAsNeeded(); $this->nodeData->setHiddenAfterDateTime($dateTime); $this->context->getFirstLevelNodeCache()->flush(); + $this->emitNodePropertyChanged($this, '_hiddenAfterDateTime', $oldValue, $dateTime); $this->emitNodeUpdated($this); } @@ -1483,10 +1493,13 @@ public function setHiddenInIndex($hidden): void if ($this->isHiddenInIndex() === $hidden) { return; } + $oldValue = $this->isHiddenInIndex(); + $this->emitBeforeNodePropertyChange($this, '_hiddenInIndex', $oldValue, $hidden); $this->materializeNodeDataAsNeeded(); $this->nodeData->setHiddenInIndex($hidden); $this->context->getFirstLevelNodeCache()->flush(); + $this->emitNodePropertyChanged($this, '_hiddenInIndex', $oldValue, $hidden); $this->emitNodeUpdated($this); }