Skip to content

Commit

Permalink
Merge branch 'hotfix/fix_legend_for_untrans_models' into 'release/2.3.0'
Browse files Browse the repository at this point in the history
Fix output legends for untranslated models

See merge request metamodels/core!300
  • Loading branch information
zonky2 committed Jul 12, 2024
2 parents 3e38d14 + e867dfa commit b2b75ce
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ Feel free to contribute the MetaModel Documentation in [EN](https://github.com/M
## Resources:

* [MetaModels Website](https://now.metamodel.me)
* [MetaModels Contao Wiki [DE]](https://de.contaowiki.org/MetaModels)
* [MetaModels Contao Community Subforum [DE]](https://community.contao.org/de/forumdisplay.php?149-MetaModels)
* [MetaModels Channel on Contao Slack #metamodels](https://contao.slack.com/archives/CKGEBDV60)

Expand Down
2 changes: 1 addition & 1 deletion src/BackendIntegration/InputScreen/InputScreen.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ protected function translateRows($rows)
// First pass, fetch all attribute names.
$columnNames = [];
foreach ($rows as $row) {
if ($row['dcatype'] != 'attribute') {
if ($row['dcatype'] !== 'attribute') {
continue;
}

Expand Down
6 changes: 4 additions & 2 deletions src/CoreBundle/Translator/MetaModelTranslationLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,11 @@ private function handleInputScreen(
$prefix = 'inputscreen.' . $inputScreen['meta']['id'] . '.';

foreach ($inputScreen['legends'] as $index => $legend) {
$value = $this->extractLangString($legend['label'], $locale, $mainLanguage) ?? '';
$value = $this->extractLangString($legend['label'], $locale, $mainLanguage);
// Suffix '_legend' due to EditMask in DcGeneral.
$catalog->set($prefix . $index . '_legend', $value, $domain);
if (null !== $value) {
$catalog->set($prefix . $index . '_legend', $value, $domain);
}
}

if ('standalone' === $inputScreen['meta']['rendertype']) {
Expand Down

0 comments on commit b2b75ce

Please sign in to comment.