Issue Bug Closed

#45513pi_getLL does not allow clearing labels via Typoscript any more

Stephan Großberndt 02/15/13, 15:53 updated 09/26/13, 10:45

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.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.