Review main Merged

73099[TASK] Avoid TBE_EDITOR declaration via synchronous script tag

Benjamin Franzke CR +2 V +2 Easy +3 −24 updated 01/21/22, 15:58

Commit message

TBE_EDITOR is only needed for the legacy, inline-javascript based,
TBE_EDITOR.customEvalFunctions registry, therefore the synchronous
script jsfunc.tbe_editor.js is almost always loaded without
ever being used in requests if no legacy code is loaded.

The remaining usages of TBE_EDITOR.registerCustomEvaluation have been
migrated to TBE_EDITOR.registerCustomEvaluation in #95954
(rsee eturnFieldJs in redirects SourceHost evaluation), therefore
TBE_EDITOR.customEvalFunctions is subject for deprecation anyway, and
it's fine to guard any TBE_EDITOR.customEvalFunctions assignment
with a fallback-factory for TBE_EDITOR and to remove jsfunc.tbe_editor.js.

Review

  • Code review CR +2 Done
    • Benjamin Franzke +2
    • Andreas Kienast +1
    • Benni Mack +1
  • Verified V +2 Done
    • Benjamin Franzke +2
    • Andreas Kienast +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 1

Files 5

Review log 1114

  1. Benjamin Franzke uploaded patch set 1 01/20/22, 08:08

  2. Benjamin Franzke commented on patch set 1 01/20/22, 08:10

    Note: Can be tested by changing returnFieldJS() in typo3/sysext/redirects/Classes/Evaluation/SourceHost.php back to: public function returnFieldJS(): string { $jsCode = []; $jsCode[] = 'if (value === \'*\') {return value;}'; $jsCode[] = 'var parser = document.createElement(\'a\');'; $jsCode[] = 'parser.href = value.indexOf(\'://\') != -1 ? value : \'http://\'; + value;'; $jsCode[] = 'return parser.host;'; return implode(' ', $jsCode); } (As it has been prior https://review.typo3.org/c/Packages/TYPO3.CMS/+/72154 has been merged)
  3. Benjamin Franzke wrote 01/20/22, 08:10

    Topic set to esm
  4. Benjamin Franzke commented on patch set 1 01/20/22, 08:12

    I'm not aware that this breaks stuff, but I'd still rather do not backport to 11.5 as it might cause issues for some very legacy code that TBE_EDITOR is no longer declared by default.
  5. Benjamin Franzke uploaded patch set 2 01/20/22, 08:14

  6. Benjamin Franzke commented on patch set 2 CR -1 01/20/22, 08:15

  7. core-ci voted on patch set 1 V +1 01/20/22, 08:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22299

  8. core-ci voted on patch set 2 V +1 01/20/22, 08:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22300

  9. Benjamin Franzke uploaded patch set 3 01/21/22, 09:27

  10. core-ci voted on patch set 3 V +1 01/21/22, 09:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22337

  11. Andreas Kienast voted on patch set 3 V +1 CR +1 01/21/22, 15:20

  12. Benni Mack voted on patch set 3 V +1 CR +1 01/21/22, 15:57

  13. Benjamin Franzke voted on patch set 3 V +2 CR +2 01/21/22, 15:58

  14. Benjamin Franzke merged patch set 4 01/21/22, 15:58