Bug #65662
closedhideIfNotTranslated expects integer 2 instead of 1 as TRUE value
0%
Description
When using two different default language configurations (for two separate trees) there is a problem with handling of sys_language_mode.
In typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php > settingLanguage #2725 the Method >page['l18n_cfg']) is used to differentiate between exit directly or handle with sys_language_mode.
GeneralUtility::hideIfNotTranslated($this
The method is filled with l18n_cfg column from pages table. This can be 0 or 1.
In both cases it will return FALSE. It can only return TRUE if value 2 is set.
In the backend it's not possible to set this value to 2.
(This may be reversed with $GLOBALS['TYPO3_CONF_VARS']['FE']['hidePagesIfNotTranslatedByDefault'])
if (GeneralUtility::hideIfNotTranslated($this->page['l18n_cfg'])) {
$this->pageNotFoundAndExit('Page is not available in the requested language.');
} else {
switch ((string) $this->sys_language_mode) {
case 'strict':
...
break;
case 'content_fallback':
...
break;
case 'ignore':
...
break;
default:
...
}
}
I think the Method hideIfNotTranslated has to be changed to work with 0 or 1.
Maybe like this:
static public function hideIfNotTranslated($l18n_cfg_fieldValue) {
if ($GLOBALS['TYPO3_CONF_VARS']['FE']['hidePagesIfNotTranslatedByDefault']) {
return $l18n_cfg_fieldValue ? FALSE : TRUE;
} else {
return $l18n_cfg_fieldValue ? TRUE : FALSE;
}
}
Updated by Benni Mack almost 7 years ago
- Status changed from New to Needs Feedback
- Assignee set to Benni Mack
We fixed this behaviour IMHO with a proper xor check in v7 I think. Can you check if your issue still exists?
Updated by Riccardo De Contardi over 6 years ago
- Status changed from Needs Feedback to Closed
- Assignee deleted (
Benni Mack)
No feedback since the last 90 days => closing this issue.
If you think that this is the wrong decision or experience the issue again on recent TYPO3 versions like 7.6.x or 8.7.x and have more information about how to reproduce your problem, please reopen it or open a new issue with a reference to this one. Thank you.