Actions
Bug #45513
closedpi_getLL does not allow clearing labels via Typoscript any more
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Localization
Target version:
-
Start date:
2013-02-15
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
4.7
PHP Version:
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:
Description
Since TYPO3 4.7.4 (in 4.5 the issue does not exist) it is not possible anymore to clear a language label.
Example:
pi_list_browseresults_page is a label used in pibase->pi_list_browseresults to prepend e.g. "Page" to the links to pages, so you get "Page 1 - Page 2 - Page 3 - ..." as links. The fallback value in browseresults is "Page":
$pageText = trim($this->pi_getLL('pi_list_browseresults_page','Page',$hscText).' '.($a+1));
Before 4.7.5 it was possible to add Typoscript in the template like this:
plugin.tx_myplugin_using_pagebrowse { _LOCAL_LANG.de { pi_list_browseresults_page = } }
resulting in a cleared pi_list_browseresults_page that produces the links "1 - 2 - 3 - ...".
This is due to the !empty-check in pi_getLL - it does not allow an empty string and directly jumps to the else case.
public function pi_getLL($key, $alternativeLabel = '', $hsc = FALSE) { $word = NULL; if (!empty($this->LOCAL_LANG[$this->LLkey][$key][0]['target'])) {
Using a check like this resolves the problem:
public function pi_getLL($key, $alternativeLabel = '', $hsc = FALSE) { $word = NULL; if (!empty($this->LOCAL_LANG[$this->LLkey][$key][0])) {
No check for the actual value of the label but check, if there is a existing definition with source/target instead.
Actions