Review 13.4 Merged

95849[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
  • Verified V +2 Done
    • Benjamin Franzke +2
    • core-ci +1 CI

Issues 1

Files 1

Review log 34

  1. Benjamin Franzke commented on patch set 1 09/15/26, 09:12

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V +1 09/15/26, 09:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/108603

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

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