Review main Merged

95846[BUGFIX] Suppress warnings from `GeneralUtility::writeFile()`

Benjamin Franzke CR +2 V +2 Easy +3 −3 updated 09/15/26, 10:09

Commit message

Callers of `GeneralUtility::writeFile()` are supposed to
check the return value to check for errors.

`GeneralUtility::writeFile()` uses PHP directory functions
which can emit E_WARNING additionally to their error
return value.

Currently, when `SYS/exceptionalErrors` contains E_WARNING,
the TYPO3 ErrorHandler transforms those lowlevel warnings into
a generic exception of type `TYPO3\CMS\Core\Error\Exception`.

To prevent any usage of `GeneralUtility::writeFile()` having to
catch this exception, we make sure to supress all warnings,
in order to prevent the error handler from generating an exception.
This is fine since we check the return values in order to check
for success.

Review

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

Issues 1

Files 1

Review log 56

  1. Benjamin Franzke uploaded patch set 1 09/15/26, 08:48

  2. Simon Schmidt voted on patch set 1 CR +1 V +1 09/15/26, 08:55

  3. Stefan Bürk voted on patch set 1 CR +1 V +1 09/15/26, 09:00

  4. core-ci voted on patch set 1 V +1 09/15/26, 09:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/108595

  5. Benjamin Franzke voted on patch set 1 CR +2 V +2 09/15/26, 09:12

  6. Benjamin Franzke merged patch set 2 09/15/26, 10:09