Skip to content

Commit

Permalink
Merge branch 'hotfix/fix_eddit_all' into 'release/2.3.0'
Browse files Browse the repository at this point in the history
Fix editAll link and other small fixes

See merge request metamodels/core!299
  • Loading branch information
zonky2 committed Jul 11, 2024
2 parents 6f00909 + dfba03d commit 3e38d14
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,11 @@ private function addEditMultipleCommand(Contao2BackendViewDefinitionInterface $v
->setLabel('editAll.label')
->setDescription('editAll.description');

$parameters = $command->getParameters();
$parameters['act'] = 'select';
$extra = $command->getExtra();
$extra['class'] = 'header_edit_all';
$parameters = $command->getParameters();
$parameters['act'] = 'select';
$parameters['select'] = 'models';
$extra = $command->getExtra();
$extra['class'] = 'header_edit_all';

$commands->addCommand($command);
}
Expand Down
11 changes: 1 addition & 10 deletions src/Helper/LocaleUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,7 @@ final class LocaleUtil
*/
public static function formatAsLanguageTag(string $localeId): string
{
$packages = System::getContainer()->getParameter('kernel.packages');
assert(is_array($packages));
$coreVersion = $packages['contao/core-bundle'] ?? '';

if (\version_compare($coreVersion, '4.13', '>=')) {
return self::formatAsLocale($localeId);
}

// Legacy call.
return \str_replace('_', '-', ContaoLocaleUtil::formatAsLocale($localeId));
return self::formatAsLocale($localeId);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/TranslatedMetaModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public function selectLanguage(string $activeLanguage): string
protected function fetchTranslatedAttributeValues(ITranslated $attribute, $ids)
{
// @deprecated usage of TL_LANGUAGE - remove for Contao 5.0.
$originalLanguage = LocaleUtil::formatAsLocale($GLOBALS['TL_LANGUAGE']);
$originalLanguage = LocaleUtil::formatAsLocale($GLOBALS['TL_LANGUAGE'] ?? 'en');
$GLOBALS['TL_LANGUAGE'] = LocaleUtil::formatAsLanguageTag($this->getLanguage());

try {
Expand Down

0 comments on commit 3e38d14

Please sign in to comment.