Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] Avoid PHP error with empty GLOBALS lang #26

Closed
wants to merge 1 commit into from

Conversation

xf-
Copy link
Contributor

@xf- xf- commented Aug 12, 2015

Core does not check against empty lang. - Empty means it uses complete object, not the wanted language. This sets a lang if it is empty.

@NamelessCoder shouldn't we disable it in FE?

return $data;
}
if (TRUE === empty($GLOBALS['TSFE']->lang)) {
$GLOBALS['TSFE']->lang = $languageKey;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We definitely do not want to be doing this. It is far from the job of FLLL to be manipulating the frontend context - we should instead plan and simple avoid processing when no language is set and no default is given.

Be aware also that the "TSFE" object has changed in recent TYPO3 versions. The public property may no longer be trustworthy or the correct way of resolving the current language.

@xf-
Copy link
Contributor Author

xf- commented Aug 13, 2015

The behavior is really strange. In my option it is the fault of T3 API, it is public and allows empty values, but does not allow default and checks against it. Default isn't set in core class and throws the Exception.

@NamelessCoder
Copy link
Member

It is absolutely the fault of TYPO3's API - the question is, how do we avoid the situation without manipulating the frontend context? We don't want the situation where FLLL is actually patching what is essentially a bug, or even setting a value that makes some other extension or the core itself fail to use languages correctly. Instead, we want the situation where FLLL either doesn't try to generate labels or becomes capable of resolving the default language if this bad API public property is empty.

@xf- xf- force-pushed the workaroundExceptionLang branch 2 times, most recently from 891bd8b to 33194cc Compare August 13, 2015 23:26
@NamelessCoder
Copy link
Member

Hook that caused the issue is now removed. We should not prevent building of labels completely in FE, rather avoid the problem at the source. Thanks btw for helping me track down the source last week!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants