Closed (fixed)
Project:
Devel
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Sep 2007 at 03:37 UTC
Updated:
11 Oct 2007 at 20:11 UTC
I found a small but annoying bug while investigating this issue: http://drupal.org/node/170557
When drupal_goto is invoked after form redirect, devel tries to write to footer of the redirect response, after Location header is set. This results in watchdog errors, since theme is already unloaded and working dir is already reset.
The fix is very simple - to add a check that $theme global still exists.
| Comment | File | Size | Author |
|---|---|---|---|
| devel.module_14.patch | 618 bytes | dkruglyak |
Comments
Comment #1
moshe weitzman@drupal.org commentedhow does a theme get unloaded? i haven't looked very closely yet.
the whole point of the forum redirection page is that you stop the redirect so developer can view the queries and other debug info. does this patch compromise that?
Comment #2
dkruglyak commentedHow it gets unloaded? Not sure, perhaps some subtle issue/bug in how PHP shutdown functions interact with headers...
This can be tracked by putting a watchdog call into shutdown function to output $theme var and current directory with getcwd(). If there is no redirect they are ok (current theme and drupal home dir). However, once drupal_goto called header("Location") PHP starts cleanup and watchdog shows $theme unset and current dir set to '/'. Then devel_shutdown tries to reload the theme and fails since the working directory is reset - dumping senseless messages into the log...
Redirection option of devel module is not compromised by this patch - I tested it. The patch condition is only triggered when $theme has been unset, that happens only in extraodinary circumstances...
Comment #3
moshe weitzman@drupal.org commentedi think i fixed this differently. please reopen if not.
Comment #4
(not verified) commented