Invalid Pattern Config Data Can Cause White Screen on Render

Created on 2 January 2024, 12 months ago
Updated 23 January 2024, 11 months ago

Problem/Motivation

When rendering a Patternkit block, the config data for each block is loaded as a JSON string from a serialized data field. If this data value doesn't successfully decode as a JSON value, the JSON exception is thrown before error handling for Patternkit blocks is in place to capture the render failure and prevent a white screen.

Through normal operation, these value should never get saved as invalid JSON strings, but unexpected events may lead to this scenario and the module should be able to handle the issue gracefully.

Steps to reproduce

  1. Place a new patternkit block on a page and save the layout
  2. In the database, find the corresponding record in the patternkit_field_revision table
  3. Replace the data value with the following string: s:0:"";
  4. Clear all caches
  5. Reload the saved page
  6. Observer the white screen failure

Proposed resolution

Add exception handling when the block's render element is being assembled, and replace with a pattern error element instead of the config doesn't load successfully.

User interface changes

None

API changes

None

Data model changes

None

🐛 Bug report
Status

Fixed

Version

9.1

Component

Module Core

Created by

🇺🇸United States slucero Arkansas

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024