Issue Bug Closed

#66352UriBuilder calls getTargetPageTypeByFormat with wrong extension name (affects extbase formatToPageTypeMapping)

Philipp Kerling 04/10/15, 11:04 updated 10/02/18, 11:45

Description

With TYPO3 6.2, extbase introduced the option to map specific formats to page type numbers automatically with the view.formatToPageTypeMapping setting.

This is how the target page type number is currently determined for links in TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder:

$targetPageType = $this->extensionService->getTargetPageTypeByFormat($this->request->getControllerExtensionKey(), $this->format);

However, getTargetPageTypeByFormat in ExtensionService excepts the first parameter to be an extension name, not an extension key. This means that the mapping lookup will always fail when those two differ (which should almost always be the case).
Changing getControllerExtensionKey() to getControllerExtensionName() solves the issue for me.

As a side note, the “documentation” of this feature which I could only find at http://forge.typo3.org/attachments/download/26372/TYPO3-v6-2-whats-new.english.pdf is wrong. It says to set plugin.tx_myextension.view.formatToPageTypeMapping, but the correct location is plugin.tx_myextension.settings.view.formatToPageTypeMapping.

Reviews 2