Issue Bug Closed

#96374Wrong include path calculated for RequireJS

Francois Suter 12/16/21, 15:14 updated 10/04/22, 14:17

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:

https://foo.com/var/www/html/vendor/cobweb/external_import/Resources/Public/JavaScript/Contrib/jquery.dataTables.js?bust=1639666788

instead of:

https://foo.com/typo3conf/ext/external_import/Resources/Public/JavaScript/Contrib/jquery.dataTables.js

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.