Skip to content

Commit 5e53d53

Browse files
committed
BUGFIX: Prevent metadata from loosing its workspacename
1 parent fb3ee84 commit 5e53d53

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

Classes/PrepareContentRelease/Dto/ContentReleaseMetadata.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,9 @@ private function __construct(
6060
$this->workspaceName = $workspaceName;
6161
}
6262

63-
64-
public static function create(PrunnerJobId $prunnerJobId, \DateTimeInterface $startTime, string $workspace = 'live'): self
63+
public static function create(PrunnerJobId $prunnerJobId, \DateTimeInterface $startTime, string $workspaceName = 'live'): self
6564
{
66-
return new self($prunnerJobId, $startTime, null, null, NodeRenderingCompletionStatus::scheduled(), [], $workspace);
65+
return new self($prunnerJobId, $startTime, null, null, NodeRenderingCompletionStatus::scheduled(), [], $workspaceName);
6766
}
6867

6968
public static function fromJsonString($metadataEncoded, ContentReleaseIdentifier $contentReleaseIdentifier): self
@@ -85,7 +84,7 @@ public static function fromJsonString($metadataEncoded, ContentReleaseIdentifier
8584
isset($tmp['manualTransferJobIds']) ? array_map(function (string $item) {
8685
return PrunnerJobId::fromString($item);
8786
}, json_decode($tmp['manualTransferJobIds'])) : [],
88-
$tmp['workspace'] ?? 'live'
87+
$tmp['workspaceName'] ?? 'live'
8988
);
9089
}
9190

@@ -105,24 +104,24 @@ public function jsonSerialize(): array
105104

106105
public function withEndTime(\DateTimeInterface $endTime): self
107106
{
108-
return new self($this->prunnerJobId, $this->startTime, $endTime, $this->switchTime, $this->status, $this->manualTransferJobIds);
107+
return new self($this->prunnerJobId, $this->startTime, $endTime, $this->switchTime, $this->status, $this->manualTransferJobIds, $this->workspaceName);
109108
}
110109

111110
public function withSwitchTime(\DateTimeInterface $switchTime): self
112111
{
113-
return new self($this->prunnerJobId, $this->startTime, $this->endTime, $switchTime, $this->status, $this->manualTransferJobIds);
112+
return new self($this->prunnerJobId, $this->startTime, $this->endTime, $switchTime, $this->status, $this->manualTransferJobIds, $this->workspaceName);
114113
}
115114

116115
public function withStatus(NodeRenderingCompletionStatus $status): self
117116
{
118-
return new self($this->prunnerJobId, $this->startTime, $this->endTime, $this->switchTime, $status, $this->manualTransferJobIds);
117+
return new self($this->prunnerJobId, $this->startTime, $this->endTime, $this->switchTime, $status, $this->manualTransferJobIds, $this->workspaceName);
119118
}
120119

121120
public function withAdditionalManualTransferJobId(PrunnerJobId $prunnerJobId): self
122121
{
123-
$manualTransferIdArray = self::getManualTransferJobIds();
122+
$manualTransferIdArray = $this->getManualTransferJobIds();
124123
$manualTransferIdArray[] = $prunnerJobId;
125-
return new self($this->prunnerJobId, $this->startTime, $this->endTime, $this->switchTime, $this->status, $manualTransferIdArray);
124+
return new self($this->prunnerJobId, $this->startTime, $this->endTime, $this->switchTime, $this->status, $manualTransferIdArray, $this->workspaceName);
126125
}
127126

128127
public function getPrunnerJobId(): PrunnerJobId

0 commit comments

Comments
 (0)