[TYPO3-dev] Language Menu pointing to Plugin Detail view on List page

This Mächler maechler at mm-computing.ch
Thu Apr 13 00:40:02 CEST 2017


I experience the following problem, and could not figure out how to solve it. I don't know if it's a bug or a miss-configuration: 

Setup:
- realURL 2.1.9
- TYPO3 6.2.30
- Extension on a page with list and detail action
- Language navigation, using "addQueryString" to allow language switch on detail view

After some time, the language menu on the list page has links to details instead of links to the list is alternative languages. This happens in a random manner, and must be some caching issue. After a lot of time trying to figure out the problem, I decided to post this here. 

My realURL setup:
<pre>
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']=array (
  '_DEFAULT' =>
  array (
    'init' => array (
      'enableCHashCache' => 1,
      'appendMissingSlash' => 'ifNotFile,redirect',
      'adminJumpToBackend' => true,
      'enableUrlDecodeCache' => 1,
      'enableUrlEncodeCache' => 1,
      'emptyUrlReturnValue' => '/',
    ),
    'pagePath' => array (
      'spaceCharacter' => '-',
			'rootpage_id' => 1,
			'languageGetVar' => 'L',
			'languageExceptionUids' => '1,2,3,4' // those languages will not generate localized paths!
    ),
    'preVars' => array(
    	array(
    		'GETvar' => 'L',
    		'valueMap' => array(
    			'en' => '0',
    			'fr' => '1',
    			'de' => '2',
    			'it' => '3',
    			'es' => '4'
    		),
    		'valueDefault' => 'en',
    		'noMatch' => 'bypass'
    	)
    ),
    ['postVarSets']['_DEFAULT']['tour-dates'] = array(
    	array(
    	  'GETvar' => 'tx_nemtourdates_tourdates[controller]',
       	'valueMap' => array (
        		'date-ctrl' => 'Date',
        		'ticket-reservation' => 'TicketReservation'
        ),
        'noMatch' => 'bypass'
      ),
    	array(
    	  'GETvar' => 'tx_nemtourdates_tourdates[action]',
        'valueMap' => array (
        	'liste' => 'list',
        	'detail' => 'show',
        	'form' => 'reservationForm',
        	'confirm' => 'reservation'
        ),
        'noMatch' => 'bypass'
      ),
      array(
        'GETvar' => 'tx_nemtourdates_tourdates[date]',
        'lookUpTable' => array (
          'table' => 'tx_nemtourdates_domain_model_date',
          'id_field' => 'uid',
          'alias_field' => 'title',
          'addWhereClause' => '',
         	'useUniqueCache' => 1,
    			'useUniqueCache_conf' => array(
    				'strtolower' => 1,
    				'spaceCharacter' => '-',
    			),
        ),
        'cond' => array( 'prevValueInList' => 'show,reservationForm,TicketReservation' )
      ),
    ),
  ),
);
</pre>

My language navigation:
<pre>
temp.mainTemplate.subparts.lang-switch{
	special = language
	special.value = 0,1,2,3,4
	special.normalWhenNoLanguage = 0
	1 = TMENU
	1{
		wrap = <ul>|</ul>
		NO = 1
		NO{
      # custom link building (cache, cHash!)
      doNotLinkIt = 1
			linkWrap = <li>|</li>
			stdWrap{
        override = en || fr || de || it || es
        typolink{
          parameter.data = page:uid
          additionalParams = &L=0||&L=1||&L=2||&L=3||&L=4
          addQueryString = 1
          addQueryString.exclude = L,id,cHash,no_cache
          addQueryString.method = GET
          useCacheHash = 1
          no_cache = 0
        }
      }
		}
		ACT < .NO
		ACT{
      //doNotShowLink = 1
      stdWrap.typolink >
			linkWrap = <li class="act"><span>|</span></li>
		}
		USERDEF1 < .ACT
		USERDEF1.linkWrap = <li class="na"><span>|</span></li>
		USERDEF2 < .ACT
	}
}
</pre>

relevant Typoscript:
<pre>
config{
  ...
  ...
  simulateStaticDocuments = 0
  ...
  tx_realurl_enable = 1
  prefixLocalAnchors = all
  linkVars = L
  defaultGetVars.L = 0
  # default language config
  sys_language_uid = 0
  sys_language_mode = content_fallback
  sys_language_overlay = hideNonTranslated
  language = en
  locale_all = en_EN.UTF-8
}

[globalVar = GP:L = 1]
  config.sys_language_uid = 1
  config.language = fr
  config.locale_all = fr_FR.UTF-8
[globalVar = GP:L = 2]
  config.sys_language_uid = 2
  config.language = de
  config.locale_all = de_DE.UTF-8
[globalVar = GP:L = 3]
  config.sys_language_uid = 3
  config.language = it
  config.locale_all = it_IT.UTF-8
[globalVar = GP:L = 4]
  config.sys_language_uid = 4
  config.language = es
  config.locale_all = es_ES.UTF-8
[global]
</pre>

When logged in the Backend, the language menu is generated correctly. If I clear the cache, the issue disappears, but after some hours or days, it shows up again. The language menu items on the "list" view page link to details. They should link to "list". There must be some cache entries with idendical keys or so. 





More information about the TYPO3-dev mailing list