Review main Merged

80874[BUGFIX] Fix notice in DataHandler if deleting a record

Georg Ringer CR +2 V +2 Easy +1 −1 updated 09/07/23, 06:33

Commit message

Check if a field exists before accessing it.

Review

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

Issues 1

Files 1

Review log 1720

  1. Georg Ringer uploaded patch set 1 09/06/23, 07:47

  2. Georg Ringer commented on patch set 1 09/06/23, 07:47

    This change is ready for review.
  3. Oliver Klee voted on patch set 1 CR +1 09/06/23, 07:49

  4. Oliver Klee voted on patch set 1 V +1 09/06/23, 07:50

  5. Chris Müller voted on patch set 1 CR +1 09/06/23, 07:50

  6. Mathias Brodala commented on patch set 1 09/06/23, 07:51

    DataHandler.php:5366

    Do we already have a pattern for cases like this? Right now it reads like "false" is used as fallback value for "tstamp" which would imply that it can actually have this (or "true") as value. For clarity "?? null" would be better with semantics, even if PHP then internally converts this to a boolean expression. Mostly a question, not a nitpick. ;-)
  7. Stefan Bürk voted on patch set 1 V +1 CR +1 09/06/23, 07:51

  8. core-ci voted on patch set 1 V +1 09/06/23, 07:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46265

  9. Stefan Bürk commented on patch set 1 09/06/23, 07:54

    DataHandler.php:5366 Reply

    If the fallback would be used as assignment, the "correct" value type would be mandantory. In case if the condition check, falling back to "false" is ok in this case as it really emphasizes that if not set it should be handled as false and therefore the condition not matched.
  10. Andreas Kienast commented on patch set 1 09/06/23, 07:56

    You check for tstamp, that's not a notice field.
    You mean "before", right?
  11. Georg Ringer updated the commit message in patch set 2 CR +1 V +1 09/06/23, 08:00

  12. core-ci voted on patch set 2 V +1 09/06/23, 08:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46268

  13. Kevin Appelt voted on patch set 2 V +1 CR +1 09/06/23, 08:18

  14. Benjamin Franzke commented on patch set 2 09/06/23, 19:30

    Can you please try to fix your editor to avoid this empty line in git commits between `Releases` and `Change-Id` line? Thanks.
  15. Georg Ringer updated the commit message in patch set 3 CR +1 V +1 09/07/23, 04:50

  16. core-ci voted on patch set 3 V +1 09/07/23, 04:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46319

  17. Benjamin Franzke commented on patch set 3 V +1 CR +1 09/07/23, 06:12

    DataHandler.php:5366 Reply

    yea, well, with phpstan strict rules this would be marked as an implicit condition, instead of an explicit one and we'd want `($GLOBALS['TCA'][$table]['ctrl']['tstamp'] ?? '') !== ''` then, which doesn't look pretty but would be the "perfect" condition. Anyway, we've got a dozen placed like this, so let's not discuss at this point and rather fix that in general if there is interest (which I personally would like, but I can imagine others will hate that boilerplate because of cognitive load or so)
  18. Benjamin Franzke commented on patch set 3 09/07/23, 06:12

    Reply

    Done

    Reply

    Done

    Reply

    Thanks for fixing that.
  19. Stefan Bürk voted on patch set 3 V +2 CR +2 09/07/23, 06:15

  20. Stefan Bürk merged patch set 4 09/07/23, 06:33