Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUGFIX: Add missing event emitters to internal node properties #5343

Open
wants to merge 1 commit into
base: 8.3
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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): 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);
}

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

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
Loading