white screen of death on invalid forms

kenorb - December 15, 2008 - 12:39
Project:Drupal
Version:7.x-dev
Component:base system
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

Sometimes menu_execute_active_handler() in index.php returns NULL and Drupal show nothing.
Sometimes it caused by invalid forms in some modules.

If it happens, I've got following errors in session:

warning: Illegal offset type in \trunk\includes\form.inc on line 1360.

Drupal shouldn't crash by some simple mistake in some module.

#1

kenorb - December 15, 2008 - 14:28

Probably it happens when _element_info() receiving array type instead of string.
And it can be related when theme function returns NULL as well.
I can reproduce this bug using content_profile_registration module.

#2

Damien Tournoud - December 15, 2008 - 22:33
Version:6.x-dev» 7.x-dev
Priority:critical» normal

The typical answer is that "we don't babysit broken code", which is in fact the combination of two design principles:

(1) we don't try to hide failures created by modules, because that would be the best way to have them ignored
(2) we don't add (too much) condition-checking code (except for type-hinting we can now do in D7 because we only support PHP 5.2+), because those bloat the code while being only useful in the case of a broken module

So I think we will not fix this in D6, but bumping to D7, there might be some type-hinting to add.

#3

kenorb - December 16, 2008 - 10:22

Additional case in index.php is not additional condition which will use some additional time of processor when everything is fine, but it help figure out why the screen is white. Sometimes it can be because not of broken module, but by some user arguments.
Even there can be some simple condition, that if menu_execute_active_handler() will return NULL, then go to drupal_error_page() or something, so admin will have this issue in logs. Otherwise Drupal "think" that everything is ok, but user see white screen.

 
 

Drupal is a registered trademark of Dries Buytaert.