Bug #96374
closedWrong include path calculated for RequireJS
0%
Description
Context: a backend module (extension external_import) loads the 3rd-party library Datatables using:
$publicResourcesPath = PathUtility::getAbsoluteWebPath(
ExtensionManagementUtility::extPath('external_import')
) . 'Resources/Public/';
$pageRenderer = $view->getModuleTemplate()->getPageRenderer();
$pageRenderer->addRequireJsConfiguration(
[
'paths' => [
'datatables' => $publicResourcesPath . 'JavaScript/Contrib/jquery.dataTables'
]
]
);
This worked fine until TYPO3 11.5.3 and breaks with 11.5.4.
The reason is that the path is wrongly calculated as:
instead of:
Updated by Francois Suter almost 3 years ago
This can be tested with the external_import extension. Just access the "Data Import" module and you should see a 404 error when trying to fetch the Datatables.js file. The visible effect is that the search field does nothing and that the table is not sorted in order of priority by default (however to have anything in the table, you also need to install extension "externalimport_tut").
Updated by Oliver Hader almost 3 years ago
- Status changed from New to Needs Feedback
(I assume that https://github.com/TYPO3/CmsComposerInstallers/releases/tag/v4.0.0-RC1 is used already in your particular project - in case it is not, please report back)
I've create a corresponding pull-request at https://github.com/cobwebch/external_import/pull/225 to change the path resolving.
Explanation¶
PathUtility::getAbsoluteWebPath('EXT:extension_name/')
resolves to corresponding (private) folder in Composervendor/
folderPathUtility::getAbsoluteWebPath('EXT:extension_name/Resources/Public')
resolves to (virtual) public pathtypo3conf/ext/
Updated by Francois Suter almost 3 years ago
I'm on the main branch of https://github.com/TYPO3/CmsComposerInstallers/
Updated by Oliver Hader almost 3 years ago
- Status changed from Needs Feedback to Resolved
Thx for the feedback! I'm closing this issue on the core-side. Please feel free to reopen, in case you think the TYPO3 core should behave differently here...
Updated by Francois Suter almost 3 years ago
I just verified on my side too that it worked with both v10 and v11.
Before closing this issue, I'm wondering about that change in CMS Composer Installer. I don't remember any communication about it, and since it's not directly a change in TYPO3 itself, does it get any visibility as a breaking change?