Review main Abandoned

81796[BUGFIX] Fix context menu module registration

Christian Eßl CR 0 V 0 Easy +1 −1 updated 12/04/24, 11:35

Commit message

Registering custom js context menus was broken since TYPO3 12.4,
because the script always appended ".js" to the ES6 module name.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 1

Review log 79

  1. Christian Eßl uploaded patch set 1 11/20/23, 10:04

  2. Christian Eßl updated the commit message in patch set 2 11/20/23, 10:08

  3. core-ci voted on patch set 1 V -1 11/20/23, 10:10 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/49122

  4. core-ci voted on patch set 2 V -1 11/20/23, 10:13 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/49123

  5. Andreas Kienast commented on patch set 2 CR -1 11/20/23, 10:13

    You're technically right here, this is a flaw in our API. However, fixing this is a breaking change for existing context menus. I suggest to introduce a new data attribute and deprecate the old one.
  6. Christian Eßl commented on patch set 2 11/20/23, 10:36

    Reply

    I was under the impression, that the old way of registering javascript modules no longer works at all in this scenario?
  7. Andreas Kienast commented on patch set 2 11/20/23, 10:42

    Reply Unresolved

    I don't understand your what you mean. The "old way" would be RequireJS, which is indeed not supported anymore. But it's still possible to register custom context menus, just leave out the `.js` suffix. See https://github.com/beechit/fal_securedownload/blob/master/Classes/ContextMenu/ItemProvider.php#L105-L109 for example.
  8. Oliver Hader updated the commit message in patch set 3 CR -1 V -1 10/18/24, 14:08

  9. Andreas Kienast abandoned the change 12/04/24, 11:35

    Abandoning. The patch relies on a developer bug, the original code works in ESM scenarios, as our own code proves: ``` $attributes = [ 'data-callback-module' => '@typo3/filelist/context-menu-actions', ]; ```