Problem/Motivation

Opening the Redirect entities tab inside Trash causes a White Screen of Death (WSOD) with a fatal TypeError coming from Views field rendering.

The issue occurs when accessing the Redirect entities listing at:

/admin/content/trash/redirect

The page fails before rendering the view.

Steps to reproduce

  1. Go to Trash: /admin/content/trash
  2. Click on Redirect entities: /admin/content/trash/redirect
  3. Observe the fatal error.

The page crashes with:

TypeError: Unsupported operand types: array + null in
Drupal\views\Plugin\views\field\FieldPluginBase->advancedRender()
(line 1238 of core/modules/views/src/Plugin/views/field/FieldPluginBase.php)

Issue fork trash-3592675

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

sammy_g created an issue. See original summary.

dkmishra’s picture

I am experiencing the following warnings and deprecation notices using Drupal 11.3.11, Trash module (Version: 3.0.27), and PHP 8.3.20:

  1. Warning: Undefined array key "element_label_type" in Drupal\views\Plugin\views\field\FieldPluginBase->elementLabelType() (line 311 of /var/www/html/interview/web/core/modules/views/src/Plugin/views/field/FieldPluginBase.php)
  2. Deprecated function: explode(): Passing null to parameter #2 ($string) of type string is deprecated in Drupal\views\Plugin\views\field\FieldPluginBase->elementLabelClasses() (line 411 of /var/www/html/interview/web/core/modules/views/src/Plugin/views/field/FieldPluginBase.php)
  3. Warning: Undefined array key "element_label_class" in Drupal\views\Plugin\views\field\FieldPluginBase->elementLabelClasses() (line 410 of /var/www/html/interview/web/core/modules/views/src/Plugin/views/field/FieldPluginBase.php)

These errors appear when clicking on the Redirect entities tab inside Trash. Note that while these warnings and deprecation notices are triggered, they do not result in a White Screen of Death (WSOD).

After applying the MR 127, all of the above issues are successfully resolved for me.

@sammy_g thanks.

amateescu made their first commit to this issue’s fork.

amateescu’s picture

Version: 3.0.27 » 3.1.x-dev
Status: Active » Needs review

MR 127 is basically suppressing the error by not displaying anything for the label, but we can do better: for label fields that have multiple properties, we should display the main property. Opened MR 128 with this approach, and test coverage.

  • amateescu committed 79f36018 on 3.1.x
    fix: #3592675 WSOD when opening Redirect entities tab in Trash
    
    By:...

  • amateescu committed 01ec32a5 on 3.x
    fix: #3592675 WSOD when opening Redirect entities tab in Trash
    
    By:...
amateescu’s picture

Status: Needs review » Fixed

The Drupal CI failure is for pgsql, and it fails on HEAD as well, so it's an infra problem. Merged MR 128 into 3.1.x and cherry-picked to 3.x. Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.