Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Resource wildwebmidi.data not found in Composer-based installations #1367

Open
markusweigelt opened this issue Oct 24, 2024 · 1 comment

Comments

@markusweigelt
Copy link
Contributor

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:

  1. Install dlf extension in Composer-based Typo3 12 installation

Expected Behavior

wildwebmidi.data loads without 404 from _assets folder

Solution

Use path of caller file wildwebmidi.js maybe with document.currentScript.

Because it looks like a library that is also used in other projects, I didn't fix it.

@markusweigelt
Copy link
Contributor Author

markusweigelt commented Oct 25, 2024

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]

https://github.com/markusweigelt/kitodo-presentation/blob/c2534ae53a65c8f95a8d81db234b2038eaa4ae40/Configuration/TypoScript/setup.typoscript#L72-L80

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";

https://github.com/markusweigelt/kitodo-presentation/blob/c2534ae53a65c8f95a8d81db234b2038eaa4ae40/Resources/Public/JavaScript/WildWebMidi/wildwebmidi.js#L4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant