Skip to content

[BUGFIX] Avoid exceptions on NULL pi_flexform - #1394

Open
YKWeyer wants to merge 1 commit into
in2code-de:typo3-v13from
zecm-via:bugfix/empty-flexform
Open

[BUGFIX] Avoid exceptions on NULL pi_flexform#1394
YKWeyer wants to merge 1 commit into
in2code-de:typo3-v13from
zecm-via:bugfix/empty-flexform

Conversation

@YKWeyer

@YKWeyer YKWeyer commented Aug 12, 2026

Copy link
Copy Markdown

Issue

The default value of the pi_flexform column in the database is NULL.

It is possible for editors to reach that state e.g. by changing the CType of an existing ContentElement, but GeneralUtility::xml2array (used in convertFlexFormContentToArray) expects a string, causing PHP exceptions in the backend.

How to reproduce

  1. Create a new ContentElement of type Text or Header
  2. Change the CType field to Powermail
  3. When the Refresh required popup appears, select Save and refresh
  4. Close the editing of the ContentElement

Opening the page view in the backend will return a PHP exception:

(1/1) TypeError

TYPO3\CMS\Core\Utility\GeneralUtility::xml2array(): Argument #1 ($string) must be of type string, null given, called in /app/vendor/typo3/cms-core/Classes/Service/FlexFormService.php on line 40

Changes

When pi_flexform is null, then the rendering of the preview is skipped. Only an error message will be displayed in the backend:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant