Closed (duplicate)
Project:
Devel
Version:
6.x-1.x-dev
Component:
devel_themer
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Mar 2008 at 06:37 UTC
Updated:
30 Nov 2008 at 02:55 UTC
Jump to comment: Most recent file
Comments
Comment #1
ardarvin commentedHmmm....I think the error may be related to the theme itself. I'm using a newly submitted one: Artists C01 which generates the above error.
When I switch to Garland, the devel_themer module works fine.
Perhaps the theme is busted?
Comment #2
moshe weitzman commentedyeah, themer does not use classes. please flle against the theme.
Comment #3
ztyx commentedA follow up: It wasn't a question of class usage but instead only a faulty definition of
theme_feed_icon(...)that, indevel_themer.module:devel_themer_theme_twin(), resulted incount($args)being bigger thancount($params)which in turns led to trying to access a part of$paramsthat was out of limit. See http://drupal.org/node/238231 for more info and patch.This is an easy error that could happen during theming. I'm slightly new to Drupal so I don't know how to do error checking the best way, but how about solving this issue slightly more permanently by applying something similar to the attached patch? The error message will help a lot for people working on themes (including me)...
Also,
devel_themer_theme_twin()is according to its documentation a modified copy oftheme(). Maybe similar patch needs to be applied there.Comment #4
moshe weitzman commentedSending more arguments than expected is a feature of PHP that is commonly used
Comment #5
thomas23@drupal.org commentedErm, sorry, but what do I read out of this? I'm getting the same error with a self developed theme which is a subtheme of zen.
Did I do something wrong in my subtheme? If not is this a bug of zen?
Cheers.
Comment #6
cha0s commentedI just got this error when updating to Drupal 6. I don't see this as 'by design'. It is a bug that results in a fatal PHP error, and should be caught/echoed to the error console area. A patch follows, although one was written before me, but mine doesn't die(), it just echoes an error message and terminates the '$arg = $param' loop.
I shamelessly stole the text from the other patch since I didn't word it nearly as well (thinking like a coder, not a user...)
Again, we all appreciate PHP's ability to have variable number of args passed to a function, but in this specific case (because it results in a fatal PHP error) it must be caught, and an error message thrown.
[EDIT] I would be just as happy with changing the for loop to
for ($i=0; $i < min(count($args), count($params)); $i++) {
but I figured that actively warning the user would be better, since I haven't studied the code enough to know exactly why it's happening the way it is.
Comment #7
cha0s commentedSorry for the double post, I just wanted to change the status so it hopefully won't get missed. Thanks for your attention.
Comment #8
moshe weitzman commentedWe do not babysit broken code.
Comment #9
cha0s commentedWhy does PHP even throw exceptions? It'd be much better for it to throw a GPF and take down the whole system.
Echoing errors is for losers...
Comment #10
danylevskyiI have the same problem.
I noticed, that this error is thrown when I am trying to view pages with views2.
Comment #11
sidharth_k commentedI am getting this problem too. Please help
Comment #12
kenorb commentedI have the same problem when I'm going to activity (page of activity module).
Comment #13
akahn commentedI'm also having this issue with a subtheme of Zen. Not asking you to deal with anyone else's code, Moshe, but do you think you could try to explain what you think the issue is here, so that people who are experiencing it can fix it? Something that doesn't make sense to me is why I get this error only on the front page of my site, not on node views or admin pages.
Comment #14
sidharth_k commentedI agree with akahn. Given that zen is an important, mainstream theme that so many people are using...would request some help on this... many thanks!
Comment #15
akahn commentedWell, I was able to squash my bug. This isn't part of Zen out of the box. I was using
template_preprocess_user_picturein my subtheme's template.php. In that function, I was incorrectly usingtheme('imagecache',…), and that was causing the error.Comment #16
gpk commentedAlso having this problem with Acquia Marina theme. Anyone know how to find the root cause?
Ta muchly ... :)
Comment #17
gpk commentedActually the problem turns out to be in calendar_ical module, part of the Calendar package.
Many thanks to ztyx and cha0s for their suggestions. Here are more details instructions for finding out were the problem occurs, for those who aren't into patching or debuggers:
1. Make a backup copy of devel_themer.module
2. We need to Insert some debug code. The error occurs in the 2nd line below (the one with getName):
Insert the following inside the for loop, immediately before the line beginning $meta['... :
3. Now view the problem page again. You should get all sorts of useful info about the problem (probably more than is strictly needed).
The significance of $debug[4] is that this seems to report the file and line with the bad theme call :-D :-D :-D. This should enable you to pinpoint the source of the problem quickly.
Would be great if somehow this type of problem could be caught automatically, in the way that Drupal's error handler catches other problems, making it easier for bugs to be identified, and hence reported and fixed. For people (e.g. theme developers) with even less PHP than I have the pain factor when this happens would pretty high (it was bad enough for me!). Especially as it might be nothing to do with the theme in question ..! And particularly if the problem is in a block (as in my case) - can take the whole site down.
Comment #18
gpk commentedComment #19
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #20
momo18 commentedHi,
I am using Drupal 6.x, views 2 and the frontpage view, as well as panels 2, to promote a node to the front page, and I intend to use front-page.tpl.php in order to theme it differently. I am also using the devel module, the zen theme, and the zen classic sub-theme where I put the front-page.tpl.php in the subtheme folder. I'm getting the following error when I visit the front page of my test site.
The error I'm receiving is described below, and I really don't have PHP knowledge or the time to debug it fully. Anyway, here are the details. It seems to be a panels issue/problem. I know it isn't a devel problem per se, but in the devel module the problem occurred and it's somehow related. Can someone explain to me how to file or resolve this apparent panels problem. Since I've created everything on a fresh install of a test site, I know it isn't improper use of a theme or a view or something. The problem description follows below.
I want to use a sub-theme, and apparently it doesn't like a sub-theme. Unfortunately, if I cannot correct this error I might have to give up using the sub-theme feature in drupal 6. Can anyone help?
Thanks!
Moses
Technical Writing Services
www.itwrite.com
================================================================================================
Fatal error: Call to a member function getName() on a non-object in C:\xampp\htdocs\sites\all\modules\devel\devel_themer.module on line 386
================================================
I used the following debug code (mentioned above) and inserted it where recommended. The code is:
// Check for a bad theme call (see http://drupal.org/node/237056).
if ($i == count($params)) {
// Find the offending theme call
$debug = debug_backtrace();
drupal_set_message(count($args) . " arguments were passed to theme('$hook', ..) but it was only expecting " . count ($params) . ". Please debug the code that invoked theme('$hook', ..). Further debug info follows.
', 'error');
break;
}
================================================
I received the following output.
5 arguments were passed to theme('panels_default_style_render_panel', ..) but it was only expecting 4. Please debug the code that invoked theme('panels_default_style_render_panel', ..). Further debug info follows.
Array
(
[file] => C:\xampp\htdocs\sites\all\modules\panels\includes\display-render.inc
[line] => 303
[function] => theme
[args] => Array
(
[0] => panels_default_style_render_panel
[1] => panels_display Object
(
[args] => Array
(
)
[content] => Array
(
[1] => stdClass Object
(
[pid] => 1
[did] => 1
[panel] => middle
[type] => views
[subtype] => frontpage-page_1
[shown] => 1
[access] => Array
(
)
[visibility] =>
[configuration] => Array
(
[style] => rounded_corners
[override_title] => 0
[override_title_text] =>
[css_id] =>
[css_class] =>
[link_to_view] => 0
[more_link] => 0
[feed_icons] => 0
[use_pager] => 0
[pager_id] =>
[nodes_per_page] => 10
[offset] => 0
[panel_args] => 0
[args] =>
[url] =>
)
[cache] => Array
(
)
[position] => 0
[context] =>
)
)
[panels] => Array
(
[middle] => Array
(
[0] => 1
)
)
[incoming_content] =>
[css_id] =>
[context] => Array
(
)
[layout_settings] => Array
(
)
[panel_settings] => Array
(
)
[cache] => Array
(
)
[title] =>
[hide_title] => 0
[did] => 1
[layout] => onecol
[keywords] => Array
(
)
[owner] => stdClass Object
(
[pid] => 1
[name] => frontpage
[did] => 1
[title] => Groups Frontpage
[access] => Array
(
)
[path] => frontpage
[load_flags] => 0
[css_id] =>
[css] =>
[arguments] => Array
(
)
[displays] => Array
(
)
[contexts] => Array
(
)
[relationships] => Array
(
)
[no_blocks] => 0
[switcher_options] => Array
(
)
[switcher_name] =>
[switcher_type] =>
[menu] => 0
[menu_tab] =>
[menu_tab_weight] =>
[menu_title] =>
[menu_tab_default] =>
[menu_tab_default_parent_type] =>
[menu_parent_title] =>
[menu_parent_tab_weight] =>
[type] => Local
[context] => Array
(
)
[primary] => panels_display Object
*RECURSION*
[display] => panels_display Object
*RECURSION*
[current] => primary
[form] =>
[keywords] => Array
(
)
[id] => frontpage
)
[type] => panel_page
)
[2] => frontpage
[3] => Array
(
[1] => stdClass Object
(
[module] => views
[delta] => frontpagepage_1
[subject] => Front Page Moses
[content] =>
* Edit
* Export
* Clone
front page moses
Submitted by admin on Mon, 11/17/2008 - 22:41
front body moses
[title] => Front Page Moses
)
)
[4] => Array
(
)
[5] => middle
)
)
Array
(
[wildcards] => Array
(
)
[hook] => panels_default_style_render_panel
[path] => sites/all/modules/panels
[type] => func
[used] => theme_panels_default_style_render_panel
)
Array
(
[arguments] => Array
(
[display] =>
[panel_id] =>
[panes] =>
[settings] =>
)
[type] => module
[theme path] => sites/all/modules/panels
[function] => devel_themer_catch_function
[theme paths] => Array
(
[0] => sites/all/modules/panels
)
[preprocess functions] => Array
(
[0] => template_preprocess
)
[devel_function_intercept] => theme_panels_default_style_render_panel
)
=======================================================
The file display-render.inc where the problem actually began contains the following offending function that generated the error:
return theme($style['render panel'], $display, $owner_id, $panes, $style_settings, $panel);
========================================================
Comment #21
kenorb commentedSo, what's the solution?
Comment #22
gpk commentedThe solution would be to open an issue against the Panels project to let the developer know that the theme call on line 303 of display-render.inc uses incorrect arguments.
Comment #23
Bevan commentedPatch at #340677: Fatal error: Call to getName() on non-object considers input from all commentors on this thread and solves the problem in a cleaner way.