Hi,

I've updated my site from Drupal 5 to Drupal 6.10. I must say that during the update I had some problems that lead to a WSOD, and I updated the core without having some of the modules turned off (including Signup and Token modules). Now I am getting this weird error... I've created a custom Event type with CCK 6.x-2.2 and Date 6.x-2.1 and if I enable the Signup module 6.x-1.0-rc3 I get the following error in the log file and the /node/add/event page goes blank:

Missing argument 2 for _signup_token_help() in /var/www/drupal/sites/default/modules/signup/includes/token_help.inc on line 18.

I've tried to debug the issue, and from the stack trace I gather the _signup_token_help method is part of an infinite loop. I've attached a screenshot of the stack trace. I've managed to isolate the bug, and it seems that if I comment the lines no 69,70, 104 and 105 from the signup/includes/node_settings.inc the bug no longer appears - these lines create the help section for the tokens used in the confirmation/reminder emails.

I'm a little bit out of ideas on how to approach this. Maybe someone has had a similar problem and can give me some pointers on what is causing this behavior? Any comments will be appreciated.

Thanks.

CommentFileSizeAuthor
signup-error.jpg142.86 KBkatiusha

Comments

dww’s picture

Thanks for the detailed and clear report! It's definitely possible there's a bug in there. I haven't tested the tokens support very carefully yet in the D6 version. I'll have to look at this more closely when it's not 1am and I've had some sleep. ;)

dww’s picture

Category: bug » support
Status: Active » Postponed (maintainer needs more info)

Looking briefly at the code -- this is *very* strange. The signup-error.jpg screenshot makes it seem like when _signup_build_token_help() calls this:

    $help_html = theme('signup_token_help', $tokens);

your site's theme system is invoking _signup_token_help(). That's a private function used by signup, which calls _signup_build_token_help() -- that's how you're getting an infinite loop...

It's as if your theme's name is "_". :( What theme are you using?

What happens if you clear your theme registry cache?

I'm tentatively marking this a support request, since on first inspection, I don't think signup is doing anything wrong. It appears your site is really messed up in some way if theme('foo') ends up invoking _foo()... ;) That's gotta cause all sorts of other grief -- the fact that I have a theme function and a private function that share the same name doesn't strike me as a bug.

If there's a bug here, it's either in your theme, or in the theme system itself that it lets something like this happen...

katiusha’s picture

dww, thank you for the quick reply!

I have a custom theme, based on the Bluemarine theme, placed in /sites/all/themes/mytheme. I did clear the cache, multiple times ("Clear cached data" under admin/settings/performance), but no luck with that.

What you told me about the theme name made me make another test - I've added the code in theme_signup_token_help into the template.php file of my theme like this:

function phptemplate_signup_token_help($tokens) {
  $tokens_html = "<dl>\n";
  if(is_array($tokens))
	foreach ($tokens as $name => $description) {
		$tokens_html .= '<dt>['. $name .']</dt>';
		$tokens_html .= '<dd>'. $description ."</dd>\n";
	}
  $tokens_html .= "</dl>\n";

  return $tokens_html;
}

The error disappears this way. But I knew it is not compulsory to have the a themable function overridden, so I never considered adding that function to my template.php file. Something still seems wrong, but I can't tell what.

Anyway, thank you for your comments, they've been very helpful :)