Review main Merged

76943[BUGFIX] Fix exception with PHP 8.1 in ItemProcessingService

Sybille Peters CR +2 V +2 Easy +6 −4 updated 01/06/23, 15:13

Commit message

The pageId is already passed to the functon
ItemProcessingService::getProcessingItems(). This is now used instead
of retrieving the uid / pid from the row array.

The previous behaviour could result in an exception with PHP 8.1
since the uid in the row might not be initialized if a new page
is created. If a field with itemProcFunc existed for a field
in the pages table.

The page id which was passed to the function already handled
the case of empty uid by passing the uid of the parent page.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Christian Kuhn +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Christian Kuhn +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 1316

  1. Sybille Peters uploaded patch set 1 12/06/22, 20:14

  2. core-ci voted on patch set 1 V +1 12/06/22, 20:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/34738

  3. Simon Schaufelberger commented on patch set 1 12/08/22, 08:11

    ItemProcessingService.php:41

    since you change the variable name, can we use "realPageId" instead?
  4. Oliver Klee commented on patch set 1 12/08/22, 09:33

    ItemProcessingService.php:41 Reply

    … or realPageUid. (I'd prefer this, but would be fine with realPageId as well.)
  5. Sybille Peters commented on patch set 1 12/08/22, 10:15

    ItemProcessingService.php:41 Reply

    I used the same variable names as in DataHandler where this function is called and the variable passed. It think it makes sense to use the same name. Doing code cleanup alongside with this patch is not my intention. This is a bug fix, fixing a pretty serious bug (you can't create new pages anymore - under certain conditions with no workaround) with PHP 8.1 while PHP 7.4 is EOL and PHP 8.0 soon is. (it might also be reproducible with PHP 8.0, I did not test). Can we align our priorities?
  6. Sybille Peters commented on patch set 1 12/08/22, 10:20

    ItemProcessingService.php:41 Reply

    See also contribution guide: "Decide about general issues before fixing nitpicks" https://docs.typo3.org/m/typo3/guide-contributionworkflow/main/en-us/HandlingAPatch/Tips.html Did someone check if this is actually a bug and reproducible and the patch fixes it?
  7. Oliver Klee wrote 12/08/22, 14:47

    Removed cc Oliver Klee.
  8. Christian Kuhn uploaded patch set 2 V +1 01/06/23, 11:30

  9. core-ci voted on patch set 2 V +1 01/06/23, 11:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/35529

  10. Christian Kuhn uploaded patch set 3 V +1 01/06/23, 11:47

  11. Christian Kuhn commented on patch set 1 01/06/23, 11:48

    ItemProcessingService.php:41 Reply

    Ack
  12. Christian Kuhn commented on patch set 3 V +1 CR +1 01/06/23, 11:50

    I adapted this slightly: incoming $realPid seems to be always the pid of the record: the parent page uid if new pages are added, the parent page uid if an existing page is edited, and the page uid if something else than a page record is added or edited. In order to calculate the correct TS for existing pages, I still access $row now. Do you think this is fine?
  13. core-ci voted on patch set 3 V +1 01/06/23, 11:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/35532

  14. Sybille Peters commented on patch set 3 01/06/23, 12:55

    Reply

    Your way is probably safer because it uses previous functionality but also addresses possibility that array elements might be empty. Looks good. (I can't thoroughly review right now).
  15. Stefan Bürk voted on patch set 3 V +2 CR +2 01/06/23, 15:12

  16. Stefan Bürk merged patch set 4 01/06/23, 15:13