Skip to content

Commit

Permalink
#814 Fix ServerState/PublicationState value translation
Browse files Browse the repository at this point in the history
  • Loading branch information
j3nsch committed Mar 22, 2024
1 parent d6ec98b commit af3e8e3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions library/Application/Controller/Action/Helper/Translation.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,19 @@ public function getKeyForValue($modelName, $fieldName, $value)
if (
$modelName === Document::class
&& ($fieldName === 'Language'
|| $fieldName === 'Type'
|| $fieldName === 'PublicationState')
|| $fieldName === 'Type')
) {
return $value;
} elseif ($modelName === Enrichment::class && $fieldName === 'KeyName') {
return $value;
} else {
return $this->normalizeModelName($modelName) . '_' . $fieldName . '_Value_' . ucfirst($value);
switch ($fieldName) {
case 'ServerState':
case 'PublicationState':
return $this->normalizeModelName($modelName) . "_{$fieldName}_Value_{$value}";
default:
return $this->normalizeModelName($modelName) . '_' . $fieldName . '_Value_' . ucfirst($value);
}
}
}

Expand Down

0 comments on commit af3e8e3

Please sign in to comment.