Bug #93227
closedRequirejs Loader does not work after Backend route change
100%
Description
If not logged in in backend mode, the requirejs loader is used to fetch configuration for non "public" extensions.
That means, invoking the following javascript on the backend login page will currently cause a 500 internal server error:
window.require(['TYPO3/CMS/Dashboard/Grid']);
(This is just an example, this could also be RsaAuth..)
Following error occurs:
requirejs-loader-04fc729459eefbea7c13b9ba7149b326.js:67 GET http://t3core-symlinked.localhost/typo3/ajax/core/requirejs&name=TYPO3%2FCMS%2FDashboard%2FGrid 500 (Internal Server Error)
Now, this happens because the URL is /typo3/ajax/core/requirejs&name but it should be /typo3/ajax/core/requirejs?name – otherwise no route will be found.
Furthermore requirejs error handling wasn't propagated in this case.
That means javascript that provided an errback method to requirejs is not executed:
window.require(['TYPO3/CMS/Dashboard/Grid'], (m) => console.log('not called because of wrong route'), (e) => {console.error('error propagated – not called because of missing error propagation: ' + e),console.log(e, e.originalError)})
Also, requiring an invalid module should cause the errback to be invoked:
window.require(['invalid-module'], (m) => console.log('will not be called'), (e) => {console.error('error propagated: ' + e),console.log(e, e.originalError)})
Expected output:
VM2882:1 error propagated: Error: requirejs fetchConfiguration for invalid-module failed [404] VM2882:1 Error: requirejs fetchConfiguration for invalid-module failed [404] at requirejs-loader-921bd94da48f0939a1e31eb77e919040.js:132 at XMLHttpRequest.xhr.onreadystatechange (requirejs-loader-921bd94da48f0939a1e31eb77e919040.js:60) Error: Not Found at XMLHttpRequest.xhr.onreadystatechange (requirejs-loader-921bd94da48f0939a1e31eb77e919040.js:60)
Actual output:
No, as no handler is invoked.
Updated by Benjamin Franzke almost 4 years ago
- Related to Feature #93048: Introduce URL rewrites for Backend links added
Updated by Gerrit Code Review almost 4 years ago
- Status changed from New to Under Review
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67346
Updated by Gerrit Code Review almost 4 years ago
Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67307
Updated by Benjamin Franzke almost 4 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 205df9011d1cae5b71ea61a691d067d0376a4009.