Review main Merged

75536[BUGFIX] List invalid field in FormEngine review

Andreas Kienast CR +2 V +2 Normal +38 −60 updated 09/05/22, 13:17

Commit message

The FormEngine review module broke with the introduction of Bootstrap 5
due to changed API of its Popover module.

Our internal Popover wrapper is now used to render the list of failed
fields again. This also introduces another bugfix in the Popover wrapper
which updates the Popover's content once it was rendered already.

Additionally, a nasty workaround is added: previously, the field id was
stored as a data attribute to the list item in the validation list.
Somewhere in the Popover > Bootstrap > PopperJS handling, those custom
data attributes are removed before rendering the HTML. To circumvent
this issue, the field is now added as last element in the `classList`
DOMTokenList for later use.

Review

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

Issues 1

Files 4

Review log 1418

  1. Andreas Kienast uploaded patch set 1 08/23/22, 11:37

  2. Andreas Kienast uploaded patch set 2 08/23/22, 11:39

  3. core-ci voted on patch set 2 V +1 08/23/22, 11:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30373

  4. core-ci voted on patch set 1 V +1 08/23/22, 11:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30372

  5. Oliver Hader commented on patch set 2 08/23/22, 13:01

    Hm, hm, hm... not sure how to say it... but, using `classList` to transport runtime-payload does not feel correct.
  6. Andreas Kienast commented on patch set 2 08/23/22, 13:51

    Reply

    I know, I feel dirty doing so. I also thought about using a Map object, mapping the fieldId to the list item element but then I'd have to iterate over all entries to get the correct key.
  7. Andreas Kienast uploaded patch set 3 08/25/22, 05:51

  8. core-ci voted on patch set 3 V +1 08/25/22, 06:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30433

  9. Benjamin Franzke commented on patch set 3 08/25/22, 11:43

    Reply

    Maybe use an inline event listener with link.addEventListener('clicl', ...) (which automatically has the context it needs) instead of registering a global one with: $document.on('click', '.' + this.fieldListItemClass, this.switchToField); Should be possible, as objects with class="t3js-field-item" are only dynamically created AFAICS(?)
  10. Benjamin Franzke commented on patch set 3 08/25/22, 11:52

    Reply

    Sorry, my suggestion doesn't work, due to: content: $list.wrapAll('<div>').parent().html()
  11. Benjamin Franzke uploaded patch set 4 08/25/22, 11:59

  12. Benjamin Franzke commented on patch set 3 08/25/22, 11:59

    Reply

    Popover content may also be simply an "Element", so we could use that to pass the list directly in order not to run into the problem that bootstrap's xss sanitizer drops our attributes: https://blog.getbootstrap.com/2019/02/13/bootstrap-4-3-1-and-3-4-1/ Done.
  13. Benjamin Franzke voted on patch set 4 V +1 CR +1 08/25/22, 12:02

  14. core-ci voted on patch set 4 V +1 08/25/22, 12:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30444

  15. Andreas Kienast commented on patch set 4 08/25/22, 12:09

    Much better, thanks a lot
  16. Jochen Roth voted on patch set 4 V +1 CR +1 09/05/22, 13:16

  17. Andreas Kienast voted on patch set 4 V +2 CR +2 09/05/22, 13:17

  18. Andreas Kienast merged patch set 5 09/05/22, 13:17