Download & Extend

Enabling theme developer creates fatal error

Project:Devel
Version:7.x-1.x-dev
Component:devel_themer
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Hi everyone,

When I enable the drupal theme developer module, I get the following error message:

Fatal error: Call to undefined function drupal_function_exists() in /Users/rhache/Sites/layoutstudio/version7/sites/all/modules/devel/devel_themer.module on line 443

When I disable the theme developer module from the database, I get a screen that continually repeats this error:

Notice: Undefined variable: output in /Users/rhache/Sites/layoutstudio/version7/includes/theme.inc on line 921

I'm using the September 8 dev releases for both Drupal 7 & Devel

Rene

Comments

#1

I fixed this by simply changing it to use function_exists instead of drupal_function_exists. That opens up a whole new bunch of errors related (I think) to the new file API in Drupal 7, so I'm going through and trying to iron those out now. The errors mean that no CSS is output in head.

For example, line 490 needs to be changed to something like this:

file_unmanaged_save_data(serialize($GLOBALS['devel_themer_server']), "temporary://devel_themer_$request_id");

...instead of using file_put_contents() and file_directory_temp().

I'll have a look through the issue queue, if no one is already on it I'll have a shot at rolling a patch of my own.

#2

Ok...I can fix up the file issues, but there are much bigger issues around devel_themer killing all the standard theme variables (styles, scripts) etc, which I need to work out! I'll have a deeper look, hopefully I get some time this week to roll up a patch.

#3

Ok this is my first ever patch, I hope I've rolled it up ok. From what I can see, all of the theme variables are killed but only in the admin backend:

* Notice: Undefined variable: classes in include() (line 38 of /Applications/MAMP/htdocs/drupal/modules/block/block.tpl.php).
* Notice: Undefined variable: attributes in include() (line 38 of /Applications/MAMP/htdocs/drupal/modules/block/block.tpl.php).
* Notice: Undefined variable: head in include() (line 49 of /Applications/MAMP/htdocs/drupal/modules/system/html.tpl.php).
* Notice: Undefined variable: styles in include() (line 51 of /Applications/MAMP/htdocs/drupal/modules/system/html.tpl.php).
* Notice: Undefined variable: scripts in include() (line 52 of /Applications/MAMP/htdocs/drupal/modules/system/html.tpl.php).
* Notice: Undefined variable: classes in include() (line 54 of /Applications/MAMP/htdocs/drupal/modules/system/html.tpl.php).
* Notice: Undefined variable: attributes in include() (line 54 of /Applications/MAMP/htdocs/drupal/modules/system/html.tpl.php).
* Notice: Undefined variable: page_top in include() (line 55 of /Applications/MAMP/htdocs/drupal/modules/system/html.tpl.php).
* Notice: Undefined variable: page_bottom in include() (line 57 of /Applications/MAMP/htdocs/drupal/modules/system/html.tpl.php).

Otherwise, the devel themer module should work for the front end of the site.

Note, I put in a temporary placeholder for drupal_function_exists in devel.module, as I'm not sure whether that function is going to be in D7 or not.

I'll try and get a debugger set up here so that I can work out what causes the theme variables to be killed in the admin area.

AttachmentSizeStatusTest resultOperations
devel_themer-571566.patch5.01 KBIgnored: Check issue status.NoneNone

#4

Well, I applied this patch and it got rid of the fatal error.

Not sure if it should get set as needs review as I don't think the bot's going to test it.

Looked like the enabling the theme developer module made it all come out in Stark. Not sure that was the plan. Disabling this module brought it back to Garland.

#5

Status:active» fixed

Already fixed the file_directory_temp() stuff because it was replaced with file_directory_path('temporary'). Committed the rest to CVS. Thanks!

#6

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here