Benenne Medien ohne Anzeigenamen nach ihrem Arbeitstitel
Deploy Test / test (push) Successful in 1m49s
Deploy Test / deploy (push) Successful in 32s

Der Name eines Lizenzartikels fällt auf den Arbeitstitel oder die Bezeichnung des Inhalts
zurück, bevor die Kennung erscheint. Das Begleitmaterial zeigte im Shop sonst die Kennung.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
StommerandClaude Sonnet 5.5 committed 2026-11-21 18:37:58 +01:00
1 parent 4520dba2f0
commit 9701777011
3 files changed
+40 -7

No files matched your search

+24 -3
View File
@@ -110,9 +110,30 @@ public function articleTitle(?LicenseArticle $article): string
return '–';
}
// Wie in der Redaktion: eigener Name, sonst der Name des Inhalts, zuletzt die Kennung.
$name = app(EditorialProfileReader::class)->read($article, 'detail')->value('display_title');
return $this->articleName($article) ?: (string) $article->code;
}
return (string) (filled($name) ? $name : ($article->working_title ?: $article->code));
/**
* Name wie in der Redaktion: eigener Name, sonst der Name des Inhalts (Anzeigename, Arbeitstitel oder
* Bezeichnung), sonst der eigene Arbeitstitel; leer, wenn nichts davon vorhanden ist.
*/
public function articleName(LicenseArticle $article): string
{
$profile = app(EditorialProfileReader::class)->read($article, 'detail');
$source = $profile->source;
$candidates = [
$profile->value('display_title'),
$article->working_title,
$source?->getAttribute('working_title'),
$source?->getAttribute('designation'),
];
foreach ($candidates as $candidate) {
if (filled($candidate)) {
return trim((string) $candidate);
}
}
return '';
}
}