Review main Merged

93405[BUGFIX] Prevent TypeError on NULL in RecordFieldPreviewProcessor

Garvin Hicking CR +2 V +2 Easy +3 −0 updated 03/31/26, 12:32

Commit message

When using the Page Layout module on a page that has a content
element whose field resolves to NULL, the RecordFieldPreviewProcessor
can receive that as input for the HTML sanitizer, which only
allows string values.

Instead of casting to a string and returning an empty content,
the processor can now bail out early with a null response.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Georg Ringer +1
    • Oliver Klee +1
  • Verified V +2 Done
    • Benni Mack +2
    • Georg Ringer +1
    • core-ci +1 CI

Issues 2

Files 1

Review log 912

  1. Garvin Hicking uploaded patch set 1 03/27/26, 15:41

  2. Garvin Hicking commented on patch set 2 03/27/26, 15:43

    Published edit on patch set 1.
  3. core-ci voted on patch set 2 V +1 03/27/26, 16:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98894

  4. core-ci voted on patch set 1 V +1 03/27/26, 16:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98893

  5. Oliver Klee commented on patch set 2 03/27/26, 16:28

    RecordFieldPreviewProcessor.php:127

    `RawRecord::get()` returns `mixed` (and I'd assume the records are `RawRecords`). So, to ensure that we only use strings, we should use this: ```suggestion if (!is_string($content)) { ```
  6. Garvin Hicking commented on patch set 3 V +1 03/27/26, 17:03

    Published edit on patch set 2.
  7. Garvin Hicking commented on patch set 3 03/27/26, 17:03

    RecordFieldPreviewProcessor.php:127 Reply

    Indeed, good suggestion, thanks!
  8. core-ci voted on patch set 3 V +1 03/27/26, 17:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98904

  9. Oliver Klee voted on patch set 3 CR +1 03/28/26, 09:56

  10. Georg Ringer voted on patch set 3 CR +1 V +1 03/31/26, 12:17

  11. Benni Mack voted on patch set 3 CR +2 V +2 03/31/26, 12:32

  12. Benni Mack merged patch set 4 03/31/26, 12:32