Project

General

Profile

Actions

Bug #93227

closed

Requirejs Loader does not work after Backend route change

Added by Benjamin Franzke almost 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend JavaScript
Target version:
Start date:
2021-01-06
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Feature #93048: Introduce URL rewrites for Backend linksClosedOliver Bartsch2020-12-10

Actions
Actions #1

Updated by Benjamin Franzke almost 4 years ago

  • Related to Feature #93048: Introduce URL rewrites for Backend links added
Actions #2

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

Actions #3

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

Actions #4

Updated by Benjamin Franzke almost 4 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #5

Updated by Benni Mack over 3 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF