Skip to content

Drale1/8.x/fix php 8 type error in block design regions or hidden regions in dxpr theme.theme#782

Open
drale1 wants to merge 2 commits into8.xfrom
drale1/8.x/Fix-PHP-8-TypeError-in-block_design_regions-or-hidden_regions-in-dxpr_theme.theme
Open

Drale1/8.x/fix php 8 type error in block design regions or hidden regions in dxpr theme.theme#782
drale1 wants to merge 2 commits into8.xfrom
drale1/8.x/Fix-PHP-8-TypeError-in-block_design_regions-or-hidden_regions-in-dxpr_theme.theme

Conversation

@drale1
Copy link
Collaborator

@drale1 drale1 commented Feb 27, 2026

Linked issues

Fix is related to the Drupal.org issue https://www.drupal.org/project/dxpr_theme/issues/3570233

Solution

This PR adds simple is_array() guards around theme_get_setting('hidden_regions') and theme_get_setting('block_design_regions') before passing their values into array_filter() in dxpr_theme.theme.

On PHP 8+, theme_get_setting() can return null for these settings on some configurations. Passing null directly into array_filter() causes a TypeError. With the guards in place, the theme safely skips applying the related logic when the settings are not defined, and pages render without PHP fatals.

Checklist

  • I have read the CONTRIBUTING.md document.
  • My commit messages follow the contributing standards and style of this project.
  • My code follows the coding standards and style of this project.
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Need to run update.php after code changes
  • Requires a change to end-user documentation.
  • Requires a change to developer documentation.
  • Requires a change to QA tests.
  • Requires a new QA test.
  • I have updated the documentation accordingly.
  • All new and existing tests passed.

@drale1
Copy link
Collaborator Author

drale1 commented Feb 27, 2026

Although the original reporter confirmed that the patch applies cleanly and fixes the issue in their local environment, I have not been able to reliably reproduce the TypeError myself.

Because this depends on specific configuration/upgrade paths (where theme_get_setting() returns null), I’d really appreciate some extra testing from other environments before this is merged, just to make sure there are no side effects in existing sites that don’t currently hit the error.

@drale1 drale1 requested a review from jjroelofs February 27, 2026 07:31
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