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
- Go to Trash:
/admin/content/trash - Click on Redirect entities:
/admin/content/trash/redirect - 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
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
Comment #3
dkmishra commentedI am experiencing the following warnings and deprecation notices using Drupal 11.3.11, Trash module (Version: 3.0.27), and PHP 8.3.20:
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)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)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.
Comment #6
amateescu commentedMR 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.
Comment #9
amateescu commentedThe 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!