Project

General

Profile

Actions

Bug #65662

closed

hideIfNotTranslated expects integer 2 instead of 1 as TRUE value

Added by Bernd Niehues about 9 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2015-03-11
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.4
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

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
GeneralUtility::hideIfNotTranslated($this
>page['l18n_cfg']) is used to differentiate between exit directly or handle with sys_language_mode.

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;
}
}

Actions #1

Updated by Benni Mack over 6 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?

Actions #2

Updated by Riccardo De Contardi about 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.

Actions

Also available in: Atom PDF