Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
There's a white screen of death in Views UI when viewing View that doesn't have any displays.
Steps to reproduce:
- Open /admin/structure/views/view/who_s_new
- Delete the view
- Visit again /admin/structure/views/view/who_s_new and it should result into WSOD
Proposed resolution
Make our code work so that it doesn't result into WSOD.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#6 | 3060688-6.patch | 3.11 KB | volkerk |
|
Comments
Comment #2
volkerk CreditAttribution: volkerk at Thunder commentedAdded watchdog in alter function.
Comment #3
lauriiiMaybe we could just simplify this to simple boolean comparison:
if (!$dummy_dropbutton) {
Comment #4
volkerk CreditAttribution: volkerk at Thunder commentedOkay
Comment #5
Eli-TWith respect to the patch in #4; whilst I'm normally keen on early returns, this feels a little odd in a function that modifies variables passed by reference, especially where we have already made changes to $form.
It is also possible that in the future, futher actions are required in the claro_form_view_edit_form_alter(), to be processed after the block that starts
if (!empty($form['displays'])) {
This would not be reached if we hit theif (!$dummy_dropbutton)
early return condition and could lead to a subtle source of bugs.Therefore I recommend that instead of
we have something more like
Comment #6
volkerk CreditAttribution: volkerk at Thunder commentedUse nesting instead of early return as Eli-T suggested.
Comment #7
Eli-TThis looks awesome now. I've tested with and without the patch and confirm that this fixes the issue, and the change requested in #5 has been implemented.
Therefore moving to RTBC.
Comment #9
lauriiiLooks good! Thank you! Committed and pushed!