#105865UriBuilder does not respect plugin.tx_myext.view.defaultPid=auto after list_type-to-CType-migration
Description
After list_type-to-CType-migration (see https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/ContentElements/MigrationListType.html), the UriBuilder does not respect plugin.tx_$pluginSignature.view.defaultPid=auto anymore.
This is caused as the ExtensionService used to determine the PageId of the URIs to be generated may have been forgotten to be adapted accordingly.
In method \TYPO3\CMS\Extbase\Service\ExtensionService::getTargetPidByPlugin() , a query is executed to determine the correct Pid of the requested controller. This query only addresses plugins with CType list and and according list_type, and does not include Plugins with an individual CType. Thus it fails to return the correct Pid to the UriBuilder, which then generates URIs pointing to a potentially wrong page.
$pages = $queryBuilder
->select('pid')
->from('tt_content')
->where(
$queryBuilder->expr()->eq(
'list_type',
$queryBuilder->createNamedParameter($pluginSignature)
),
$queryBuilder->expr()->eq(
'CType',
$queryBuilder->createNamedParameter('list')
),
$queryBuilder->expr()->eq(
'sys_language_uid',
$queryBuilder->createNamedParameter($languageId, Connection::PARAM_INT)
)
)
This should be changed to also include Plugin CTypes, sth. like:
->where(
$queryBuilder->expr()->eq(
'CType',
$queryBuilder->createNamedParameter($pluginSignature)
),
$queryBuilder->expr()->eq(
'CType',
$queryBuilder->createNamedParameter('list')
),
)
->orWhere(
$queryBuilder->expr()->eq(
'CType',
$queryBuilder->createNamedParameter($pluginSignature)
)
)
->andWhere(
$queryBuilder->expr()->eq(
'sys_language_uid',
$queryBuilder->createNamedParameter($languageId, Connection::PARAM_INT)
)
)Reviews 1
Related issues 1
History 810
-
Daniel Regelein changed description <span data-processor="relativetime" data-value="2024-12-28T01:17:52+00:00" > 12/28/24, 01:17 </span>
-
Daniel Regelein changed description <span data-processor="relativetime" data-value="2024-12-28T01:22:41+00:00" > 12/28/24, 01:22 </span>
-
Garvin Hicking changed Related to #105538 <span data-processor="relativetime" data-value="2024-12-28T15:12:28+00:00" > 12/28/24, 15:12 </span>
-
Gerrit Code Review pushed patch set 2 for 13.4 to change 87597 status
NewUnder Review <span data-processor="relativetime" data-value="2024-12-28T15:13:21+00:00" > 12/28/24, 15:13 </span> -
Gerrit Code Review pushed patch set 3 for 13.4 to change 87597 <span data-processor="relativetime" data-value="2024-12-28T15:21:40+00:00" > 12/28/24, 15:21 </span>
-
Garvin Hicking commented and changed assigned to Garvin Hicking priority
Should haveMust have target version <span data-processor="relativetime" data-value="2024-12-28T15:32:56+00:00" > 12/28/24, 15:32 </span> -
Daniel Regelein commented <span data-processor="relativetime" data-value="2024-12-31T14:43:20+00:00" > 12/31/24, 14:43 </span>
Hi Garvin,
thank you for getting into this and providing a fix. It now works as intended.
Happy new year, best regards
Daniel -
Garvin Hicking commented <span data-processor="relativetime" data-value="2024-12-31T15:49:59+00:00" > 12/31/24, 15:49 </span>
Great, thanks for the feedback. If you want you could vote on the patch on gerrit to push things forward. ;-)
-
Garvin Hicking commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2025-01-02T11:00:09+00:00" > 01/02/25, 11:00 </span>Applied in changeset commit:d8a0ca3a3d65b1f9985650eb5ebfb26eece36031.
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2025-08-12T14:36:30+00:00" > 08/12/25, 14:36 </span>
Hi Daniel,
thanks for your report. v13 actually did not perform this CType lookup properly.
With v14, this was already fixed (with the removal of “list_type”, which is still available in 13.4).
I’ve created a patch assigned to this ticket which you may be able to try out and verify if it works for you? It would only affect v13 then, not v14. I’ve added a test to ensure this scenario is covered there now.
Best regards,
Garvin