diff --git a/api/src/Entity/ContentNode/ColumnLayout.php b/api/src/Entity/ContentNode/ColumnLayout.php index 59532e71d4c..ffdca823f79 100644 --- a/api/src/Entity/ContentNode/ColumnLayout.php +++ b/api/src/Entity/ContentNode/ColumnLayout.php @@ -138,4 +138,14 @@ public function getSupportedSlotNames(): array { return $columns->map(fn (array $element) => $element['slot'])->getValues(); } + + #[ApiProperty(readable: false, writable: false)] + public function setCreateTime(\DateTime $createTime): void { + $this->createTime = $createTime; + } + + #[ApiProperty(readable: false, writable: false)] + public function setUpdateTime(\DateTime $updateTime): void { + $this->updateTime = $updateTime; + } } diff --git a/api/src/State/CategoryCreateProcessor.php b/api/src/State/CategoryCreateProcessor.php index b7ff4cc41f5..66aec1af57e 100644 --- a/api/src/State/CategoryCreateProcessor.php +++ b/api/src/State/CategoryCreateProcessor.php @@ -30,6 +30,14 @@ public function onBefore($data, Operation $operation, array $uriVariables = [], ->findOneBy(['name' => 'ColumnLayout']) ; $rootContentNode->data = ['columns' => [['slot' => '1', 'width' => 12]]]; + /* + * Set the timestampable properties here by hand, because only in production + * this does not work. + * Remove this again as soon as https://github.com/ecamp/ecamp3/issues/3662 is really fixed. + */ + $rootContentNode->setCreateTime(new \DateTime()); + $rootContentNode->setUpdateTime(new \DateTime()); + $data->setRootContentNode($rootContentNode); return $data;