Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Notice: Trying to get property of non-object in drupal-6.5\includes\theme.maintenance.inc on line 250
Notice: Undefined property: stdClass::$language in drupal-6.5\themes\garland\maintenance-page.tpl.php on line 16
when mysql is off and error_reporting = E_ALL in php.ini..
note: this is displayed by the server not as a Drupal error message..
Comment | File | Size | Author |
---|---|---|---|
#5 | db-error-page-319769-D7.patch | 655 bytes | Dave Reid |
#5 | db-error-page-319769-D6.patch | 614 bytes | Dave Reid |
Comments
Comment #1
Dave ReidWait...mysql is off?
Comment #2
Pasqualleyes, the mysql server was turned off when I saw the php notice on the maintenance page.. I did not tested further, if it is necessary to reproduce the bug..
Comment #3
Dave ReidI can duplicate this error. It's because Drupal can't connect to the database (I changed my database connection info in settings.php to an invalid database), so Drupal is not really at fault. You still get the Drupal maintenance page right? I guess we could be a little better at not showing non-fatal errors.
Comment #4
Dave ReidFound a fix...patch coming shortly.
Comment #5
Dave ReidThe function _db_error_page does not call drupal_init_language, which is causing the PHP notice on global $language. If you take a look at install_main and update.php, they both do a bootstrap to DRUPAL_BOOSTRAP_CONFIGURATION, and call drupal_init_language() right before the call to drupal_maintenance_theme(). We need to do the same thing on _db_error_page to prevent this PHP notice.
Steps to reproduce this error:
- Have a valid, already installed Drupal ready
- Change your settings.php to an invalid database
- The db error page shows PHP notice
Attached are very little patches for D7 and D6. I have confirmed that in D6 this fixes the bug, there is some logic error in D7 that instead of showing a db down page, it goes back to install.php (which calls drupal_init_language). This should be RTBC.
Comment #6
Dave ReidI should leave this on 6.x since that's where this can be fixed first, then we can worry about 7.x
Comment #7
Dave ReidIdeally there should just be a drupal_init_language call made in _drupal_maintenance_theme since we need to do it every time we call drupal_maintenance_theme, but that should probably be a separate issue.
Comment #8
Pasqualletested on D6.5
the notice is gone after the patch..
Comment #9
Dave ReidMarking as RTBC. Can't really test this...
Comment #10
dvessel CreditAttribution: dvessel commentedDave, you shouldn't mark it RTBC for your own patch.
I did test it though and it works though so RTBC by me.
No, that wouldn't be right since the maintenance page could already have been through a bootstrap when updating and the late phases of the initial install. They all funnel through that same function. Your current patch is fine.
Comment #11
Dave ReidSorry dvessel. Sometimes I get a little trigger-happy. :)
Comment #12
Gábor HojtsyCommitted to Drupal 6. Moving to Drupal 7.
Comment #13
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD as well. Thanks.
Comment #14
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.