Open markusweigelt opened 1 week ago
Does not work with document.currentScript.src
because the current script is a merged version of all JavaScript files and is located in a different directory than the extension's assets.
Since I was interested in finding a solution, I discovered a satisfactory approach that works in both and next TYPO3 versions out of the box.
[typo3.branch=="11.5"]
page.inlineSettings {
dlfAssets = /typo3conf/ext/dlf/Resources/Public/
}
[else]
page.inlineSettings {
dlfAssets = /_assets/007831ab53eafe3f6be2b9b1baf2a8d6/
}
[end]
After adding this to TypoScript and clearing the cache, the URL can be correctly built with this inline setting.
var REMOTE_PACKAGE_BASE= TYPO3.settings.TS.dlfAssets+"JavaScript/WildWebMidi/wildwebmidi.data";
Description
wildwebmidi.js
references an incorrect file location.A significant change in TYPO3 12 is to load public resources from the
_assets
folder, where the public resource folders of extensions are symlinked.A clear and concise description of what the bug is.
Reproduction
Steps to reproduce the behaviour:
dlf
extension in Composer-based Typo3 12 installationExpected Behavior
wildwebmidi.data
loads without 404 from_assets
folderSolution
Use path of caller file
wildwebmidi.js
maybe withdocument.currentScript
.Because it looks like a library that is also used in other projects, I didn't fix it.