Skip to content

Commit

Permalink
Use the default marker template file if no file has been set for a sp…
Browse files Browse the repository at this point in the history
…ecial language
  • Loading branch information
franzholz committed Oct 15, 2021
1 parent f5c7d73 commit d8e9219
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions marker/class.tx_ttproducts_marker.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ public function init ($cObj, $piVars, $conf, $config) {
$language = $languageObj->getLanguage();

if ($language == '' || $language == 'default' || $language == 'en') {
if (!$markerFile) {
$markerFile = $defaultMarkerFile;
}
if ($markerFile) {
if (
version_compare(TYPO3_version, '9.4.0', '>=')
Expand All @@ -94,6 +97,9 @@ public function init ($cObj, $piVars, $conf, $config) {
} else if (ExtensionManagementUtility::isLoaded(ADDONS_EXT)) {
$markerFile = 'EXT:' . ADDONS_EXT . '/' . $language . '.locallang.xml';
}
if (!$markerFile) {
$markerFile = $defaultMarkerFile;
}
} else if (substr($markerFile, 0, 4) == 'EXT:') { // extension
list($extKey, $local) = explode('/', substr($markerFile, 4), 2);
$filename='';
Expand All @@ -109,6 +115,7 @@ public function init ($cObj, $piVars, $conf, $config) {
$this->setErrorCode($errorCode);
}
}

if ($markerFile) {
if (
version_compare(TYPO3_version, '9.4.0', '>=')
Expand All @@ -119,6 +126,7 @@ public function init ($cObj, $piVars, $conf, $config) {
$markerFile = $GLOBALS['TSFE']->tmpl->getFileName($markerFile);
}
}

if (!$markerFile) {
throw new \RuntimeException('Error in tt_products: No marker file for language "' . $language . '" set.', 50011);
}
Expand Down Expand Up @@ -454,6 +462,3 @@ public function getMarkerFields (
return $retArray;
}
}



0 comments on commit d8e9219

Please sign in to comment.