Skip to content

Commit

Permalink
Fix(AssetDefinition): prevent PHP warning about missing translation o…
Browse files Browse the repository at this point in the history
…n create
  • Loading branch information
stonebuzz committed May 7, 2024
1 parent ce8abdb commit e4d8778
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Asset/AssetDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,10 @@ private function hasRightsEnabled(): bool
*/
public function getTranslatedName(int $count = 1): string
{
if ($this->isNewItem()) {
return '';
}

$translations = $this->getDecodedTranslationsField();
$language = Session::getLanguage();
$current_translation = $translations[$language] ?? null;
Expand Down

0 comments on commit e4d8778

Please sign in to comment.