Review main Merged

71072[TASK] Deprecate and replace onchange & onclick attrs in FormEngine

Oliver Hader CR +2 V +2 Expert +884 −174 updated 09/24/21, 08:02

Commit message

Previously, `fieldChangeFunc` items have been declared as string and
were forwarded as plain inline JavaScript to the client application
using HTML attrs `onchange` and `onclick`.

This change introduces semantic objects for those `fieldChangeFunc`
items that either can be used as structured configuration (JSON) or
still "serialized" to inline JavaScript for legacy applications. New
`OnFieldChangeInterface` provides a hybrid component that is backward
compatible and still supports inline JavaScript as fallback.

Using scalar (string) instructions for `fieldChangeFunc` will
trigger PHP deprecation errors.

Review

  • Code review CR +2 Done
    • Oliver Hader +2
    • Oli Bartsch +1
    • Benni Mack +1
  • Verified V +2 Done
    • Oliver Hader +2
    • Oli Bartsch +1
    • Jonas Eberle +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 1

Files 33

Show 13 more files

Review log 2333

Show 58 earlier messages
  1. Oliver Hader uploaded patch set 1 09/13/21, 12:52

  2. core-ci voted on patch set 1 V +1 09/13/21, 13:04 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/16652

  3. Oliver Hader uploaded patch set 2 09/13/21, 16:08

  4. Oliver Hader wrote 09/13/21, 16:09

    Topic set to inline-javascript
  5. core-ci voted on patch set 2 V +1 09/13/21, 16:19 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/16661

  6. Oliver Hader uploaded patch set 3 09/13/21, 16:24

  7. Oliver Hader uploaded patch set 4 09/13/21, 16:34

  8. core-ci voted on patch set 3 V +1 09/13/21, 16:35 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/16662

  1. core-ci voted on patch set 4 V +1 09/13/21, 16:52 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/16664

  2. Oliver Hader uploaded patch set 5 09/13/21, 20:55

  3. Oliver Hader uploaded patch set 6 09/13/21, 21:01

  4. core-ci voted on patch set 5 V +1 09/13/21, 21:13 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/16678

  5. core-ci voted on patch set 6 V +1 09/13/21, 21:15 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/16679

  6. Oliver Hader uploaded patch set 7 09/14/21, 07:58

  7. core-ci voted on patch set 7 V +1 09/14/21, 08:13 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/16687

  8. Oliver Hader rebased onto patch set 8 09/14/21, 09:14

  9. core-ci voted on patch set 8 V +1 09/14/21, 09:31 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/16691

  10. Benni Mack voted on patch set 8 V +1 CR +1 09/23/21, 08:41

  11. Oli Bartsch commented on patch set 8 V -1 09/23/21, 11:28

    Can no longer check "toggle checkboxes", e.g. `pages.no_follow`.
  12. Oliver Hader commented on patch set 8 09/23/21, 11:51

    AbstractFormElement.php:348

    logical mistake here..
  13. Oliver Hader uploaded patch set 9 09/23/21, 12:50

  14. Oliver Hader commented on patch set 9 09/23/21, 12:51

    AbstractFormElement.php:348 Reply

    Done
  15. core-ci voted on patch set 9 V +1 09/23/21, 13:05 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17102

  16. Benni Mack voted on patch set 9 V +1 CR +1 09/23/21, 16:24

  17. Oli Bartsch commented on patch set 9 09/23/21, 17:27

    RadioElement.php:93

    Now unused

    UserSysFileStorageIsPublicElement.php:99

    This variable seems to be undefined

    Deprecation-91787-DeprecateInlineJavaScriptInFieldChangeFunc.rst:17

    of
  18. Oli Bartsch uploaded patch set 10 09/23/21, 17:28

  19. Oli Bartsch commented on patch set 10 V +1 CR +1 09/23/21, 17:28

    RadioElement.php:93 Reply

    Done

    UserSysFileStorageIsPublicElement.php:99 Reply

    Done

    Deprecation-91787-DeprecateInlineJavaScriptInFieldChangeFunc.rst:17 Reply

    Done
  20. core-ci voted on patch set 10 V +1 09/23/21, 17:44 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17115

  21. Jonas Eberle commented on patch set 10 V +1 09/23/21, 19:46

    I tested custom elements with the provided extension, linkhandler, checkboxes, displayCond. I watched for onclick/onfocus in the DOM (and found some in ckeditor...). I realized that with backward-compatibility we can't deliver a strict CSP by default yet. But this is great stuff! Thank you!
  22. Benni Mack voted on patch set 10 V +1 CR +1 09/24/21, 06:11

  23. Oliver Hader commented on patch set 10 V +2 CR +2 09/24/21, 07:56

    Thx for the reviews and changes, folks!
  24. Oliver Hader merged patch set 11 09/24/21, 07:56

  25. Oliver Hader commented on patch set 11 09/24/21, 08:02

    Reply

    Thx for the feedback. I would have loved to remove these inline scripts directly, but of course users also must have the chance to migrate their code to use the new declarations. In case you identify more inline scripts in the backend area, feel free to create a new sub-task at https://forge.typo3.org/issues/87418.