Skip to content

Commit

Permalink
Merge pull request #5343 from die-wegmeister/8.3
Browse files Browse the repository at this point in the history
BUGFIX: Add missing event emitters to internal node properties
  • Loading branch information
mhsdesign authored Jan 20, 2025
2 parents 81c32fc + 2fbca18 commit 470664a
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Neos.ContentRepository/Classes/Domain/Model/Node.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace Neos\ContentRepository\Domain\Model;

/*
Expand Down Expand Up @@ -1349,7 +1350,7 @@ public function setRemoved($removed): void
$this->materializeNodeData();
}

if ((boolean)$removed === true) {
if ((bool)$removed === true) {
/** @var $childNode Node */
foreach ($this->getChildNodes() as $childNode) {
$childNode->setRemoved(true);
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -1421,10 +1425,13 @@ public function setHiddenBeforeDateTime(?\DateTimeInterface $dateTime = null): v
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);
}

Expand Down Expand Up @@ -1452,10 +1459,13 @@ public function setHiddenAfterDateTime(?\DateTimeInterface $dateTime = null): vo
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);
}

Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 470664a

Please sign in to comment.