Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

lookupTable and languagField / transOrigPointerField does not work correctly #28

Open
AndreasA opened this issue Nov 7, 2016 · 2 comments

Comments

@AndreasA
Copy link
Contributor

AndreasA commented Nov 7, 2016

The check in regards to the languageField is:

 if ($cfg['languageGetVar'] && $cfg['transOrigPointerField'] && $cfg['languageField'])

languageGetVar is wrong here because it is not part of the lookUpTable configuration but of the general pagePath setting. Simplest check is probably if $this->detectedLanguage >= 0

Might be used somewhere else in the method too.

@helhum
Copy link
Owner

helhum commented Nov 7, 2016

Please add information on scenario, configuration, expectation and actual behavior

@AndreasA
Copy link
Contributor Author

AndreasA commented Nov 7, 2016

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT'] = [
    'pagePath' => [
        'languageGetVar'    => 'L'
    ],
'postVarSets' => [
        '_DEFAULT' => [
            'news' => [
                [
                    'GETvar'      => 'tx_news_pi1[news]',
                    'lookUpTable' => [
                        'table'                 => 'tx_news_domain_model_news',
                        'id_field'              => 'uid',
                        'alias_field'           => 'title',
                        'addWhereClause'        => ' AND NOT deleted',
                        'useUniqueCache'        => 1,
                        'languageField'         => 'sys_language_uid',
                        'transOrigPointerField' => 'l10n_parent',
                        'useUniqueCache_conf'   => [
                            'strtolower'     => 1,
                            'spaceCharacter' => '-',
                        ],
                    ],
                ],
            ],
        ],
    ],

This configuration doesn't translate the news title to non-default language although languageField and transOrigPointerField are configured.

What is required is to modify the lookupTable configuration to add
'languageGetVar' => 'L',
like this:

 'news' => [
                [
                    'GETvar'      => 'tx_news_pi1[news]',
                    'lookUpTable' => [
                        'table'                 => 'tx_news_domain_model_news',
                        'id_field'              => 'uid',
                        'alias_field'           => 'title',
                        'addWhereClause'        => ' AND NOT deleted',
                        'useUniqueCache'        => 1,
                        'languageGetVar'        => 'L', 
                        'languageField'         => 'sys_language_uid',
                        'transOrigPointerField' => 'l10n_parent',
                        'useUniqueCache_conf'   => [
                            'strtolower'     => 1,
                            'spaceCharacter' => '-',
                        ],
                    ],
                ],

Which doesn't make sense as the languageGetVar is already specified in the pagePath section and it is also not mentioned in the realurl manual

I mean maybe that is the expected behaviour but I would expect the languageGetVar to be the one defined in pagePath to be used for lookupTable entries too.

Maybe with the possibility to override it but definitely not as requirement.

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

No branches or pull requests

2 participants