Review main Merged

88062[TASK] Declare DH->process_datamap() returns void

Christian Kuhn CR +2 V +2 Easy +4 −46 updated 02/07/25, 10:27

Commit message

DataHandler->process_datamap() almost always returns void.
The single exception is a seldom matching early return
false in case the user is in a workspace and the workspace
is frozen.

There are many other failure cases and the general
DataHandler strategy is to log them and skip further
processing without returning result status. Developers
taking care of sucessful DH operations thus have to check
DH->errorLog anyways. The false return for the above
single error case is only additional overhead from this
point of view making everything even more complex.

The patch avoids this return false and declares return
void in process_datamap().

Review

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

Issues 1

Files 4

Review log 810

  1. Christian Kuhn uploaded patch set 1 02/06/25, 22:42

  2. Christian Kuhn updated the commit message in patch set 2 02/06/25, 22:47

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

  4. core-ci voted on patch set 2 V +1 02/06/25, 22:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73680

  5. Mathias Brodala commented on patch set 2 02/07/25, 07:50

    DataHandlerTest.php:680

    Don't we need a replacement test which ensures that none of the passed data is processed in this case? (The current test failed to do the latter.)
  6. Stefan Bürk commented on patch set 2 CR +1 V +1 02/07/25, 08:39

    DataHandlerTest.php:680 Reply

    This unit test was quite use-less, and never tested anything really. So removing it for now is IMO okay. But you are right, it make sense to add a functional test for this case as a dedicated change, but out of the scope of this minimal change. Additional task.
  7. Benni Mack voted on patch set 2 CR +1 V +1 02/07/25, 10:02

  8. Oli Bartsch voted on patch set 2 CR +1 V +1 02/07/25, 10:04

  9. Christian Kuhn commented on patch set 2 CR +2 V +2 02/07/25, 10:09

    DataHandlerTest.php:680 Reply

    i removed that test since it doesn't add much value and the subject setup sucks so much. it is obvious on reading the code returns early and changing something like this can be easily seen in patches during review. we *may* add a functional test for this, but this wouldn't add much value, either. i thus decided to just remove the test.
  10. Christian Kuhn merged patch set 3 02/07/25, 10:27