Project

General

Profile

Actions

Bug #66352

closed

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

Added by Philipp Kerling over 9 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2015-04-10
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

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.

Actions

Also available in: Atom PDF