#108779Plugin's partial can be inaccessible if there are multiple partialRootPaths
Description
This seems to be similar to #81099. It was fixed for TYPO3 v11 & v12 but in v13 the fixed method is deprecated and not used.
Suppose I use EXT:news and want to extend the NewsController with new views. I create a EXT:test/Classes/Controller/MyNewsController and register my own plugin. I want to reuse some partials of EXT:news (like List/Detail but I want to override some others (like List/Item). Here is what I do in TS:
plugin.tx_test.view {
partialRootPaths {
10 = EXT:news/Resources/Private/Partials/
15 = EXT:eventnews/Resources/Private/Partials/
20 = EXT:test/Resources/Private/Partials/
}
}
According to the documentation it should search EXT:test/Resources/Private/Partials/ for partials and if it cannot find the partial there, it should search EXT:news/Resources/Private/Partials/ , right?
Wrong.
The actual order becomes:
[ 0 => 'EXT:test/Resources/Private/Partials/', 1 => 'EXT:news/Resources/Private/Partials/', 2 => 'EXT:eventnews/Resources/Private/Partials/', ]
So partials from EXT:news will always be used and not mine.
Why?
Look at ActionController::resolveView() :
$partialRootPaths = ['EXT:' . $extensionKey . '/Resources/Private/Partials/'];
if (!empty($configuration['view']['partialRootPaths']) && is_array($configuration['view']['partialRootPaths'])) {
$partialRootPaths = array_merge($partialRootPaths, ArrayUtility::sortArrayWithIntegerKeys($configuration['view']['partialRootPaths']));
}
So $partialRootPaths becomes:
[ 0 => 'EXT:test/Resources/Private/Partials/', 10 => 'EXT:news/Resources/Private/Partials/', 15 => 'EXT:eventnews/Resources/Private/Partials/', 20 => 'EXT:test/Resources/Private/Partials/', ]
Still good, though there is a duplicate of my path.
Next we have TemplatePaths::setLayoutRootPaths(), which calls ArrayUtility::sortArrayWithIntegerKeys() and TemplatePaths::sanitizePaths(), which calls array_unique(), and … And then we have this:
[ 1 => 'EXT:test/Resources/Private/Partials/', 2 => 'EXT:news/Resources/Private/Partials/', 3 => 'EXT:eventnews/Resources/Private/Partials/' ]
So my 20 entry has gone because ActionController::resolveView() prepended the array with the default view path for my extension without checking that it already exists there and in the different order. Thus it changed my order of paths. Same happens for layout and template paths.
Skipping path to my ext does not change anything.
The right solution would be to check for the existence of the path in the confuguration inside the ActionController::resolveView(). If the path is explicitely set, do not prepend it. That’s all.
Reviews 4
- 13.4 92635[BUGFIX] Order template, partial and layout paths correctly in Extbase context
- main 92615[BUGFIX] Order template, partial and layout paths correctly in Extbase context
- main 92619[TASK] Increase test coverage for template path overrides
- 13.4 92620[TASK] Increase test coverage for template path overrides
Related issues 2
Files 1
History 1224
-
Dmitry Dulepov commented and changed attached 1205-wrong-path-to-partials.patch <span data-processor="relativetime" data-value="2026-01-26T16:07:36+00:00" > 01/26/26, 16:07 </span>
-
Dmitry Dulepov commented <span data-processor="relativetime" data-value="2026-01-26T16:45:20+00:00" > 01/26/26, 16:45 </span>
Now thinking about it, I believe it is not specific to extending another plugin but it will happen for any plugin where partials (or layouts or templates) match the following conditions:
- Additonal paths are given (for example, to another extension’s partials)
- A partial in another path has the same name as the partial in the extensions’s directory (like both have
Resources/Private/Partials/List/Item.html
In this case there is absolitely to way to use the partial from the current extension because its partials path will be always lower in priority than any other mentioned partials path.
-
Dmitry Dulepov changed subject
Cannot override partialRootPaths of another extension when extending the controllerPlugin's partial can be inaccessible if there are multiple partialRootPaths <span data-processor="relativetime" data-value="2026-01-26T16:48:09+00:00" > 01/26/26, 16:48 </span> -
Garvin Hicking commented <span data-processor="relativetime" data-value="2026-01-26T19:23:11+00:00" > 01/26/26, 19:23 </span>
Would you like to propose this patch to gerrit, then we can also see if Tests might react on if.
Otherwise I could insert your patch to the system, but without doing git author stuff. ;)
-
Dmitry Dulepov commented <span data-processor="relativetime" data-value="2026-01-28T08:35:43+00:00" > 01/28/26, 08:35 </span>
I will try myself until the end of the week. If there are already tests for the ActionController, I will try add more too.
Thanks!
-
Garvin Hicking commented <span data-processor="relativetime" data-value="2026-01-28T09:34:58+00:00" > 01/28/26, 09:34 </span>
Great, thanks! Simon also accepted this as a problem and “mishap”, so I’m positive we’ll get this through.
-
Gerrit Code Review pushed patch set 1 for main to change 92615 status
NewUnder Review <span data-processor="relativetime" data-value="2026-02-01T11:58:47+00:00" > 02/01/26, 11:58 </span> -
Gerrit Code Review pushed patch set 2 for main to change 92615 <span data-processor="relativetime" data-value="2026-02-01T12:05:08+00:00" > 02/01/26, 12:05 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 92615 <span data-processor="relativetime" data-value="2026-02-01T12:55:56+00:00" > 02/01/26, 12:55 </span>
-
Simon Praetorius changed Related to #108823 <span data-processor="relativetime" data-value="2026-02-01T17:17:47+00:00" > 02/01/26, 17:17 </span>
-
Simon Praetorius changed Related to #81099 <span data-processor="relativetime" data-value="2026-02-01T17:18:06+00:00" > 02/01/26, 17:18 </span>
-
Gerrit Code Review pushed patch set 4 for main to change 92615 <span data-processor="relativetime" data-value="2026-02-01T21:32:25+00:00" > 02/01/26, 21:32 </span>
-
Gerrit Code Review pushed patch set 5 for main to change 92615 <span data-processor="relativetime" data-value="2026-02-02T08:16:22+00:00" > 02/02/26, 08:16 </span>
-
Gerrit Code Review pushed patch set 6 for main to change 92615 <span data-processor="relativetime" data-value="2026-02-02T10:00:38+00:00" > 02/02/26, 10:00 </span>
-
Gerrit Code Review pushed patch set 7 for main to change 92615 <span data-processor="relativetime" data-value="2026-02-02T13:41:04+00:00" > 02/02/26, 13:41 </span>
-
Dmitry Dulepov commented <span data-processor="relativetime" data-value="2026-02-02T14:55:03+00:00" > 02/02/26, 14:55 </span>
A change to the patch.
It will not append the default path to the end. It will check if the default path is there and will not prepend it then.
See also a fix for fluid, which causes this bug: https://github.com/TYPO3/Fluid/pull/1298)
-
Gerrit Code Review pushed patch set 8 for main to change 92615 <span data-processor="relativetime" data-value="2026-02-02T16:56:03+00:00" > 02/02/26, 16:56 </span>
-
Gerrit Code Review pushed patch set 9 for main to change 92615 <span data-processor="relativetime" data-value="2026-02-02T18:45:31+00:00" > 02/02/26, 18:45 </span>
-
Gerrit Code Review pushed patch set 10 for main to change 92615 <span data-processor="relativetime" data-value="2026-02-02T19:04:26+00:00" > 02/02/26, 19:04 </span>
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 92635 <span data-processor="relativetime" data-value="2026-02-03T09:20:09+00:00" > 02/03/26, 09:20 </span>
-
Dmitry Dulepov commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-02-03T09:25:08+00:00" > 02/03/26, 09:25 </span>Applied in changeset commit:be1844c9565eeb63657a59d3eb38fa177c7d7dfc.
-
Gerrit Code Review pushed patch set 2 for 13.4 to change 92635 status
ResolvedUnder Review <span data-processor="relativetime" data-value="2026-02-03T09:43:54+00:00" > 02/03/26, 09:43 </span> -
Dmitry Dulepov commented and changed status
Under ReviewResolved <span data-processor="relativetime" data-value="2026-02-03T10:10:09+00:00" > 02/03/26, 10:10 </span>Applied in changeset commit:c0a3f83f0ec753ade1907966fa184106b03d7d52.
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2026-03-31T08:10:27+00:00" > 03/31/26, 08:10 </span>
Patch version 1.
If the patch is used as is, I would appreciate that the comitter uses
--author='Dmitry Dulepov <dmitry.dulepovgmail.com>@ while comitting. Thanks! :)