Review main Merged

88636[TASK] Remove deprecated call to `xml_set_object()`, add tests

Garvin Hicking CR +2 V +2 Normal +244 −2 updated 03/24/25, 20:05

Commit message

With PHP 8.4, the function `xml_set_object()` has been deprecated,
see [1][2].

This function allowed to set a reference to an object when using
strings in `xml_set_...()` specifications for callables.

TYPO3 already uses proper `[$this, 'method']` callable specifications,
so using `xml_set_object()` did not have any effect here.
Thus, it can not only be removed for PHP 8.4 compatibility, but also
for at least PHP 8.0 (according to [2] already since PHP 5.3).

Since any PHP version compatible to the scope of this patch's TYPO3
versions can deal without this call, it can be safely
removed.

Since the `parseXml()` methods did not provide any test coverage,
this is added with this patch, too.

[1] https://www.php.net/manual/en/migration84.deprecated.php#migration84.deprecated.core.xml
[2] https://externals.io/message/123816

Review

  • Code review CR +2 Done
    • Georg Ringer +2
    • Markus Klein +1
    • Benni Mack +1
  • Verified V +2 Done
    • Georg Ringer +2
    • Oliver Klee +1
    • Markus Klein +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 1

Files 5

Review log 2124

  1. Garvin Hicking uploaded patch set 1 03/18/25, 07:56

  2. core-ci voted on patch set 1 V +1 03/18/25, 08:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75761

  3. Andreas Kienast commented on patch set 1 03/18/25, 08:27

    12.4 is declared to be compatible with PHP 8.4 as well
  4. Garvin Hicking commented on patch set 1 03/18/25, 08:31

    Reply

    I didn't figure this kind of cleanup to be applicable to the "priority mode" of 12.4, but I'm fine with any range.
  5. Andreas Kienast commented on patch set 1 03/18/25, 08:54

    Reply

    Removing deprecated code that may lead to unnecessary bloat in log files is a fine reason for me to backport this in priority branches as well. :)
  6. Garvin Hicking updated the commit message in patch set 2 V +1 03/18/25, 10:04

  7. Garvin Hicking commented on patch set 2 03/18/25, 10:04

    Reply

    Acknowledged
  8. Markus Klein voted on patch set 2 CR +1 V +1 03/18/25, 10:05

  9. core-ci voted on patch set 2 V +1 03/18/25, 10:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75767

  10. Andreas Kienast voted on patch set 2 CR +1 03/18/25, 11:13

  11. Markus Klein commented on patch set 2 03/18/25, 13:17

    Reply

    > ... may lead to unnecessary bloat in log files ... we are not talking log files here, we are talking dysfunctional extension manager! (in dev mode, due to error reporting)
  12. Georg Ringer voted on patch set 2 CR +1 V +1 03/18/25, 15:15

  13. Stefan Bürk commented on patch set 2 03/18/25, 18:58

    That this was not covered by the pipeline means that this part of the code is not tested at all, neither direct nor indirect.
  14. Markus Klein commented on patch set 2 03/19/25, 08:25

    Reply

    Yep! And that nobody uses PHP 8.4 with classic installation to test extensions, obviously. ;-)
  15. Christian Kuhn voted on patch set 2 CR +1 V +1 03/19/25, 08:32

  16. Garvin Hicking uploaded patch set 3 CR +1 V +1 03/19/25, 09:03

  17. Garvin Hicking commented on patch set 3 03/19/25, 09:04

    Reply

    Thank you Stefan, this was helpful for me. I've added tests and learnt a bit about the XML parser (and that it's f'in hard to get a dummy extensions.xml.gz because the server blocks normal WGET requests...) Please see if those are helpful.
  18. core-ci voted on patch set 3 V +1 03/19/25, 09:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/75811

  19. Markus Klein voted on patch set 3 CR +1 V +1 03/19/25, 12:01

  20. Benni Mack voted on patch set 3 CR +1 03/20/25, 10:56

  21. Oliver Klee voted on patch set 3 V +1 03/20/25, 12:37

  22. Benni Mack voted on patch set 3 V +1 03/24/25, 20:03

  23. Georg Ringer voted on patch set 3 CR +2 V +2 03/24/25, 20:05

  24. Georg Ringer merged patch set 4 03/24/25, 20:05