Closed (fixed)
Project:
Drupal core
Component:
Other
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Jul 2002 at 10:32 UTC
Updated:
23 Nov 2002 at 01:18 UTC
I noticed on my servers where PHP Error Reporting was turned from E_ALL & ~E_NOTICE where it will report all errors except notices, to E_ALL where it shows all errors regardless that I got an error:
Notice: Undefined variable: conf in /var/www/drupal/includes/common.inc on line 776
So I looked at line 776 and it was
$conf = variable_init($conf);
I also noticed on line 767 there was
unset($conf);
which means PHP is going to complain if you try to pass it as a param I just changed line 776 to
$conf = variable_init();
since an empty array is set by function when called with no param and all is well. I dont know if this is a repeat bug but I searched and couldn't find and bug report on it.
AZTEK
Comments
Comment #1
ax commentedsame problem here: i have "error_reporting = E_ALL" in my php.ini (as suggested by php.ini-recommended: "These error messages are emitted for non-critical errors, but that could be a symptom of a bigger problem."), and this warning just fills up my error log, one line with every request.
is there a reason the
variable_init($conf);gets called with the parameter$conf(which, being undefined, causes the warning), i mean, is it possible at all that$confhas some value before this call? cause if not, just change the call tovariable_init();as AZTEK suggests, and we are rid of the problem.please someone look at this.
Comment #2
(not verified) commentedThe current behaviour is correct.
$conf[] lets you override configuration options in the config file. This is handy if you run multiple sites off one database.
A proper fix would be to check if $conf is set before using it.
Comment #3
(not verified) commentedApplied Ax's patch so this is fixed.
Comment #4
ax commentedyou applied the patch at the wrong place: you changed
$config = conf_init(); (line 768)instead of
$conf = variable_init($conf); (line 779)result is that drupal dies with "PHP Fatal error: Call to undefined function: db_query() in includes/common.inc on line 146" ...
Comment #5
ax commented