Halte deaktivierte Bestandteile im Aufbau, damit die Freigabe sie anzeigt.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
d12ba67b45
commit
dd67741f35
7 files changed
+93
-26
No files matched your search
@@ -676,7 +676,7 @@ public function childrenOf(string $target): string
|
||||
continue;
|
||||
}
|
||||
|
||||
$row = app(EditorialCatalog::class)->rowForTarget((string) ($member['target'] ?? ''), (int) $this->getRecord()->getKey(), allowSelf: true, allowDraft: true);
|
||||
$row = app(EditorialCatalog::class)->rowForTarget((string) ($member['target'] ?? ''), (int) $this->getRecord()->getKey(), allowSelf: true, allowDraft: true, allowBlocked: true);
|
||||
$lines[] = trim((string) ($member['role'] ?? '')).': '.($row['title'] ?? 'Bestandteil');
|
||||
}
|
||||
|
||||
@@ -1622,7 +1622,7 @@ protected function applyDraft(array $draft): void
|
||||
}
|
||||
|
||||
$requested++;
|
||||
$row = $catalog->rowForTarget((string) ($member['target'] ?? ''), (int) $this->getRecord()->getKey(), allowSelf: true, allowDraft: true);
|
||||
$row = $catalog->rowForTarget((string) ($member['target'] ?? ''), (int) $this->getRecord()->getKey(), allowSelf: true, allowDraft: true, allowBlocked: true);
|
||||
|
||||
if ($row === null) {
|
||||
continue;
|
||||
|
||||
@@ -281,11 +281,22 @@ protected function getHeaderActions(): array
|
||||
->modalHeading('Fassung freigeben')
|
||||
->modalDescription('Diese Fassung wird freigegeben. Sie erscheint dadurch nicht in der Mitgliederbibliothek, nicht auf der Website und nicht in einem Angebot. Eine deaktivierte Fassung bleibt unverändert.')
|
||||
->modalSubmitActionLabel('Freigeben')
|
||||
->visible(fn (): bool => ContentElementResource::editor())
|
||||
->visible(function (): bool {
|
||||
/** @var ContentElement $element */
|
||||
$element = $this->getRecord();
|
||||
|
||||
return ContentElementResource::editor()
|
||||
&& $element->versions()->where('status', ContentVersionStatus::Entwurf)->exists();
|
||||
})
|
||||
->action(function (array $arguments): void {
|
||||
abort_unless(ContentElementResource::editor(), 403);
|
||||
$this->report(function () use ($arguments): string {
|
||||
$version = $this->ownedVersion((int) ($arguments['version'] ?? 0));
|
||||
/** @var ContentElement $element */
|
||||
$element = $this->getRecord();
|
||||
$versionId = (int) ($arguments['version'] ?? 0);
|
||||
$version = $versionId > 0
|
||||
? $this->ownedVersion($versionId)
|
||||
: $element->versions()->where('status', ContentVersionStatus::Entwurf)->orderByDesc('number')->first();
|
||||
abort_unless($version instanceof ContentElementVersion, 404);
|
||||
$released = app(ContentService::class)->releaseElementVersion($version);
|
||||
|
||||
|
||||
Reference in new issue
Block a user