Ted Logan
Ted Logan

Reputation: 414

TYPO3 v8. Override function in Core class

I need to override the function

protected function getLanguageParameter()
{
    $states = $this->getBackendUser()->uc['moduleData']['web_view']['States'];
    $languages = $this->getPreviewLanguages();
    $languageParameter = '';
    if (isset($states['languageSelectorValue']) && isset($languages[$states['languageSelectorValue']])) {
        $languageParameter = '&L=' . (int)$states['languageSelectorValue'];
    }
    $languageParameter = '&L=1';
    return $languageParameter;
}

in the class TYPO3\CMS\Viewpage\Controller\ViewModuleController. It get called when you are open the View in the backend.

Lets say I would extend the class in my own extension. I already need a Hook that calls the function? But how can I get that hook?

Upvotes: 0

Views: 958

Answers (1)

Bernd Wilke πφ
Bernd Wilke πφ

Reputation: 10790

If the function has no hook yet you can try to insert it: make a patch and wait for it to become merged.
As 8 LTS already receives only 'priority bugfixes' it probably will not get merged.

The other way would be XClassing.

Upvotes: 1

Related Questions