Skip to content

Commit

Permalink
Correctly load the DCA labels (see contao#2540)
Browse files Browse the repository at this point in the history
Description
-----------

| Q                | A
| -----------------| ---
| Fixed issues     | Fixes contao#2536

see contao#2536 for the discussion

Commits
-------

cb3740c Correctly load the DCA labels
64d2350 Merge branch '4.9' into bugfix/dca-labels
  • Loading branch information
aschempp committed Dec 9, 2020
1 parent 0df5442 commit 137d410
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions core-bundle/src/Resources/contao/library/Contao/DcaLoader.php
Expand Up @@ -138,20 +138,6 @@ private function loadDcaFiles($blnNoCache)
*/
private function addDefaultLabels($blnNoCache)
{
// Return if there are no labels
if (!isset(static::$arrLanguageFiles[$this->strTable]))
{
return;
}

// Return if the labels have been added already
if (!$blnNoCache && isset(static::$arrLoaded['languageFiles'][$this->strTable]))
{
return;
}

static::$arrLoaded['languageFiles'][$this->strTable] = true;

// Operations
foreach (array('global_operations', 'operations') as $key)
{
Expand All @@ -167,7 +153,7 @@ private function addDefaultLabels($blnNoCache)
continue;
}

if (isset($GLOBALS['TL_LANG'][$this->strTable][$k]))
if (isset($GLOBALS['TL_LANG'][$this->strTable][$k]) || !isset($GLOBALS['TL_LANG']['DCA'][$k]))
{
$v['label'] = &$GLOBALS['TL_LANG'][$this->strTable][$k];
}
Expand All @@ -190,10 +176,7 @@ private function addDefaultLabels($blnNoCache)
continue;
}

if (isset($GLOBALS['TL_LANG'][$this->strTable][$k]))
{
$v['label'] = &$GLOBALS['TL_LANG'][$this->strTable][$k];
}
$v['label'] = &$GLOBALS['TL_LANG'][$this->strTable][$k];
}

unset($v);
Expand Down

0 comments on commit 137d410

Please sign in to comment.