Zeige Entwürfe in der Medienauswahl eines Moduls.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
b71ee8023b
commit
1168c04228
3 files changed
+38
-5
No files matched your search
@@ -220,7 +220,7 @@ public function browse(string $query, string $kind, string $dimension, int $exce
|
||||
if ($kind !== 'modul') {
|
||||
$latestElements = ContentElementVersion::query()
|
||||
->selectRaw('MAX(id)')
|
||||
->where('status', ContentVersionStatus::Bereit)
|
||||
->whereIn('status', [ContentVersionStatus::Bereit, ContentVersionStatus::Entwurf])
|
||||
->whereHas('element', function ($builder) use ($query, $like, $kind, $dimensionId): void {
|
||||
$this->constrainElement($builder, $query, $like, $kind, $dimensionId);
|
||||
})
|
||||
@@ -233,7 +233,7 @@ public function browse(string $query, string $kind, string $dimension, int $exce
|
||||
->get();
|
||||
|
||||
foreach ($elements as $version) {
|
||||
$row = $this->rowForTarget('element:'.$version->id, $exceptCompositionId);
|
||||
$row = $this->rowForTarget('element:'.$version->id, $exceptCompositionId, allowDraft: true);
|
||||
|
||||
if ($row !== null) {
|
||||
$rows[] = $row;
|
||||
@@ -371,14 +371,14 @@ public function alternatives(string $identity, int $exceptCompositionId): array
|
||||
if ($match[1] === 'medium') {
|
||||
$versions = ContentElementVersion::query()
|
||||
->where('content_element_id', $match[2])
|
||||
->where('status', ContentVersionStatus::Bereit)
|
||||
->whereIn('status', [ContentVersionStatus::Bereit, ContentVersionStatus::Entwurf])
|
||||
->orderBy('number')
|
||||
->get();
|
||||
|
||||
foreach ($versions as $version) {
|
||||
$options[] = [
|
||||
'target' => 'element:'.$version->id,
|
||||
'label' => 'Fassung '.$version->number,
|
||||
'label' => $version->status === ContentVersionStatus::Entwurf ? 'Entwurf' : 'Fassung '.$version->number,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user