Fatal error if block label is not a string|array

Created on 21 November 2024, about 1 month ago

Problem/Motivation

When the block label is not a string or array, the report page fails with the error:

TypeError: preg_replace(): Argument #3 ($subject) must be of type array|string, __PHP_Incomplete_Class given in preg_replace() (line 186 of modules/contrib/layout_builder_usage_reports/src/Form/ReportForm.php).
Drupal\layout_builder_usage_reports\Form\ReportForm->buildForm()
...

This occurs when the label value is an object, as in the case with blocks created using the Entity Block β†’ module (for example).

Prior to 1.0.3, this only generated a warning.

Proposed resolution

Handle non-string label values

Remaining tasks

  • Update
  • Test
  • Merge
  • Release

User interface changes

None

API changes

None

Data model changes

None

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States justcaldwell Austin, Texas

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