My custom theme renders Devel unusable - How can I debug this?
I am trying to use the Devel module for my site, but when I enable it, the entire site goes white. I only get a small
tag from the template, and everything after that just dosn't get displayed. This is while I am using a custom theme I developed myself. I can only assume I did something incorrectly in my theme.
I cannot load any pages after enabling devel while my theme is on, so I don't see how I can resolve the issue. The only way to fix this is to remove the theme directory from my sites/all/themes dir, then drupal displays without any templates (and errors complaining about a lack of specified template files) to navigate to the themes menu where I change themes to something that functions. This fixes the problem completely- I don't even have to uninstall Devel.
My problem is... I have no idea how to figure out what's conflicting and going horribly awry.
Why can't I use this on my custom theme? Can anybody point me to something that explains how I can make my theme Devel compliant?

Do you have error log access?
Do you know where to check your web server's error logs?
For instance, on my macbook (where I do all my testing before deploying to a live site) it's at /var/logs/httpd/error_log.
If you are running this on an ISP, check their support info for where to see your error log.
This is most likely a syntax error in your template PHP code. When I'm writing modules or themes, a PHP syntax error will cause the whole site to go blank, which is why we do testing on separate systems from live site.
So are you saying your theme was working _before_ you installed devel.module?
My first check would be the httpd server error logs.
The PHP logs are a GREAT
The PHP logs are a GREAT idea... I didn't even think of that. Probbably didn't consider it to be a PHP error, because no errors are being displayed.
For the record, my custom theme has NEVER worked with drupal... in that it has behaved as described above every time I have enabled it.
Not doing your development on a testing server... I can't even imagine what that would be like. I don't want to... I'm going to have nightmares now! :)
Just to make you feel better
It will go to a testing server before going live, but having it with me on my laptop is a great way to get the ball rolling and whip up a site, fast.
So, sleep easy. I think of it this way:
my laptop = dev system
test server = reference system
live server = production system
Hopefully you found out why the theme is causing problems. Best of luck!
ccshannon, You've taken
ccshannon, You've taken things a step further than I have it set up.
What scares me is the idea of developing and launching on the same server, with no plan to have a separate dev server.
I have tried to enable the PHP error log, but I'm not having much success so far. We have a somewhat informal server admin I need to contact... there's nothing worse than sitting on your hands with this kind of stuff :(
FWIW, we're using Windows 2003 and IIS6... no matter what I do to the php.ini file I can't get it to write errors to a logfile. Other modifications to the php.ini file (like changing the number of seconds for a PHP timeout) are reflected after a single IIS restart.
This is line #428 in my php.ini that SHOULD be pointing it to the logfile:
error_log = "D:\php_error_log"
I removed the .txt extension my friend recommended might get it to work... it didn't.
Does anybody know what it
Does anybody know what it takes to set up a PHP logfile under IIS?
I still have not been able to get a hold of our admin, and no matter what I do I can't get a PHP error log.
With no error log, debugging WHY devel turns every page into a white screen is completely impossible.
Ok I am finally back to
Ok I am finally back to tackling this particular issue. After further testing I have discovered that it is the Devel Themer module, not Devel itself that causes the issues. Has anybody had any conflicts with the Admin Menu & a custom theme using Devel?
I tried disabling the Admin Menu module, but Devel + Devel Themer still makes blank pages. I am half tempted to completely rewrite the theme, as I have no other way of figuring out what's going wrong.
Can anybody suggest anything simple that would cause white screen issues? I have one function in my template.php that creates custom Primary Links that fit into my layout, otherwise I don't see what could be breaking the theme/module.
Here is the code in my template.php file:
<?php function kfstpl_primary_links($links) {
$output = '';
foreach($links as $link) {
print l($link['title'],$link['href']);
}
return $output;
}
?>
And here is the code for my page.tpl.php
<?php // $Id: page.tpl.php,v 1.1.2.5.2.5 2008/11/13 15:33:07 psynaptic Exp $ ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language ?>" lang="<?php print $language->language ?>">
<head>
<title><?php print $head_title ?></title>
<meta http-equiv="content-language" content="<?php print $language->language ?>" />
<?php print $head ?>
<?php print $styles ?>
<?php print $scripts ?>
<base href="http://207.99.85.28" />
</head>
<body id="page_7">
<div class="main">
<!--==========header=========== -->
<div class="nav">
<span><a href="http://207.99.85.28/drupal/index.php?q=help">Help</a> <a href="http://207.99.85.28/drupal/about-us">About Us</a> <a href="http://207.99.85.28/drupal/retail-location">Retail Location</a></span>
<em>Today: <script type="text/javascript">tellTime();</script></em>
</div>
<a href="http://207.99.85.28/drupal"><div class="logo"></div></a>
<div class="menunav">
<div class="indent">
<?php print kfstpl_primary_links($primary_links);
print $search_box;
?>
</div> <!-- end indent -->
</div> <!-- end menu -->
<!--==========content=========== -->
<div id="tpl_content">
<div class="left_top">
<div class="right_top">
<div id="center">
<?php print $messages ?>
<?php if ($tabs): ?>
<div class="tabs"><?php print $tabs ?></div>
<?php endif ?>
<?php if ($title): ?>
<h1 class="page-title"><?php print $title ?></h1>
<?php endif ?>
<?php print $help ?>
<?php print $content ?>
<?php print $feed_icons ?>
</div><!--// center -->
<?php if ($right): ?>
<div id="right" class="sidebar">
<?php print $right ?>
</div>
<?php endif ?>
<div style="clear: both"></div>
</div> <!-- end right_top -->
</div> <!-- end left_top -->
</div><!-- end content -->
<!--==========footer=========== -->
<div id="footer">
<div id="footer-message"><?php print $footer_message ?></div>
</div>
</div>
</div><!--// page -->
<?php print $closure ?>
</body>
</html>
Hello, I still can't figure
Hello, I still can't figure out why Devel is breaking with my custom template. I have zero trouble with Devel Themer on any other theme. I am trying to use Views to put custom blocks on my front page, and it's impossible to figure out the proper template suggestion to modify the output. I'm tempted to ramble on about my template issue, but that won't help me solve my devel problem.
Today I decided to try disabling my contributed modules 1 by one, because nobody can suggest any reason that I would be experiencing this issue.
After each time of enabling Devel Themer, and then seeing the error, I would go to the Recent Log Entries page to see what errors it created.
First time looking at the error log, I noticed these entries:
DetailsType php
Date Tuesday, March 3, 2009 - 12:44
User matgilbert
Location http://207.99.85.28/drupal/admin/build/modules/list/confirm
Referrer http://207.99.85.28/drupal/admin/build/modules/list
Message The specialized Panels menu router rebuild failed. Some paths may not work correctly.
Severity error
Operations
So I figured, maybe it's a problem with Panels? I disabled the module completely, and I noticed three errors that seem to repeat:
DetailsType php
Date Tuesday, March 3, 2009 - 12:46
User matgilbert
Location http://207.99.85.28/drupal/admin/build/modules
Referrer http://207.99.85.28/drupal/admin/build/modules
Message Invalid argument supplied for foreach() in D:\Websites\KayakFishingStuff\drupal\includes\theme.inc on line 1762.
Severity error
DetailsType php
Date Tuesday, March 3, 2009 - 12:46
User matgilbert
Location http://207.99.85.28/drupal/admin/build/modules
Referrer http://207.99.85.28/drupal/admin/build/modules
Message array_map() [<a href='function.array-map'>function.array-map</a>]: Argument #2 should be an array in D:\Websites\KayakFishingStuff\drupal\modules\system\system.module on line 966.
Severity error
DetailsType php
Date Tuesday, March 3, 2009 - 12:47
User matgilbert
Location http://207.99.85.28/drupal/admin/build/modules
Referrer http://207.99.85.28/drupal/admin/build/modules
Message array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in D:\Websites\KayakFishingStuff\drupal\includes\theme.inc on line 1762.
Severity error
Here is a log that shows the entries. I clicked "update" after enabling Devel Themer at 12:46
error php 03/03/2009 - 12:47 Invalid argument supplied for foreach() in ... matgilberterror php 03/03/2009 - 12:47 array_keys() [<a ... matgilbert
error php 03/03/2009 - 12:47 array_map() [<a ... matgilbert
error php 03/03/2009 - 12:46 Invalid argument supplied for foreach() in ... matgilbert
error php 03/03/2009 - 12:46 array_keys() [<a ... matgilbert
error php 03/03/2009 - 12:46 array_map() [<a ... matgilbert
Those last two errors don't tell me what I'm doing wrong, only that errors are occurring inside drupal itself. How can I troubleshoot this? Suggestions? Has anybody else experienced this sort of fun before?
The "Invalid argument
The "Invalid argument supplied for foreach()" indicates the variable is not an array, i.e.
$i = 3;
foreach ($i as $value) {
will give this error.
Jerry Stuckle
*_*
If you still having the issue...
1) just browse to system table, find out a record for your custom theme, set status to 0.
2) Go to admin > build > themes, set garland or any other theme as default.
3) Enable the devel module, and disable the theme developer, if its already enabled.
4) Go to admin > build > themes, set your custom theme as default, and look for the issue.
5) If you encounter the issue, try upgrading/degrading the devel module.
Regards.
:)
Beautifulmind