Closed (fixed)
Project:
Hovertips and Clicktips
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Feb 2007 at 19:07 UTC
Updated:
11 Mar 2009 at 17:30 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jupiterchild commentedAny ideas on this? Anyone else had this problem?
The module operates OK for a time but intermittently terminates with the aforementioned fatal error message. I have to reinstall the module each time to recover from the error.
I found this is a really useful module to use with larger images. Does not take up real estate but can provide additonal information about an image on demand.
Comment #2
jupiterchild commentedI now realise this happens when I logout as a user with admin role. Immediately I logout I recieve 'Fatal error: Call to undefined function: drupal_add_css()' and Drupal bombs out.
The logs show:
access denied 18 Feb 2007 - 12:10pm sites/all/modules/hovertip/hovertip.js Anonymous
access denied 18 Feb 2007 - 12:10pm sites/all/modules/hovertip/hovertip.css Anonymous
So I guess there is some wierd access control behaviour going on here.
Comment #3
ejwensley commentedI get this behavior also. What have you done (if anything) to get around this?
Comment #4
Dave Cohen commentedI can't reproduce. Need more info. It seems odd that drupal_add_css would ever not be defined, as it should be in common.inc.
Could somebody try changing hovertip_init to be something like:
then post the debug_backtrace() result here?
Comment #5
jupiterchild commentedThis is the ouput of the debug:
Array ( [0] => Array ( [function] => hovertip_init [args] => Array ( ) ) [1] => Array ( [file] => /home/fredblogs/public_html/www.example/cms/includes/module.inc [line] => 386 [function] => call_user_func_array [args] => Array ( [0] => hovertip_init [1] => Array ( ) ) ) [2] => Array ( [file] => /home/fredblogs/public_html/www.example/cms/includes/bootstrap.inc [line] => 443 [function] => module_invoke [args] => Array ( [0] => hovertip [1] => init ) ) [3] => Array ( [file] => /home/fredblogs/public_html/www.example/cms/includes/bootstrap.inc [line] => 860 [function] => bootstrap_invoke_all [args] => Array ( [0] => init ) ) [4] => Array ( [file] => /home/fredblogs/public_html/www.example/cms/includes/bootstrap.inc [line] => 819 [function] => _drupal_cache_init [args] => Array ( [0] => 5 ) ) [5] => Array ( [file] => /home/fredblogs/public_html/www.example/cms/includes/bootstrap.inc [line] => 772 [function] => _drupal_bootstrap [args] => Array ( [0] => 5 ) ) [6] => Array ( [file] => /home/fredblogs/public_html/www.example/cms/index.php [line] => 13 [function] => drupal_bootstrap [args] => Array ( [0] => 7 ) ) )
Warning: Cannot modify header information - headers already sent by (output started at /home/fredblogs/public_html/www.example/cms/sites/all/modules/hovertip/hovertip.module:66) in /home/fredblogs/public_html/www.example/cms/includes/bootstrap.inc on line 523
Warning: Cannot modify header information - headers already sent by (output started at /home/fredblogs/public_html/www.example/cms/sites/all/modules/hovertip/hovertip.module:66) in /home/fredblogs/public_html/www.example/cms/includes/bootstrap.inc on line 524
Warning: Cannot modify header information - headers already sent by (output started at /home/fredblogs/public_html/www.example/cms/sites/all/modules/hovertip/hovertip.module:66) in /home/fredblogs/public_html/www.example/cms/includes/bootstrap.inc on line 527
Warning: Cannot modify header information - headers already sent by (output started at /home/fredblogs/public_html/www.example/cms/sites/all/modules/hovertip/hovertip.module:66) in /home/fredblogs/public_html/www.example/cms/includes/bootstrap.inc on line 528
Warning: Cannot modify header information - headers already sent by (output started at /home/fredblogs/public_html/www.example/cms/sites/all/modules/hovertip/hovertip.module:66) in /home/fredblogs/public_html/www.example/cms/includes/bootstrap.inc on line 536
Warning: Cannot modify header information - headers already sent by (output started at /home/fredblogs/public_html/www.example/cms/sites/all/modules/hovertip/hovertip.module:66) in /home/fredblogs/public_html/www.example/cms/includes/bootstrap.inc on line 544
Comment #6
Dave Cohen commentedOk, that was very hard to read, but informative nonetheless. Turns out hook_init is not what I thought it was, and in the hook_init documentation they recommend using hook_menu instead. Not intuitive, but I think it will fix the problem if the code from my hook_init is moved to hook_menu.
No time for me to produce a patch this second, but perhaps tomorrow. Thanks for the added info.
Comment #7
ejwensley commentedIf anyone has the actual changes that need to be made to make this work, please post it. Otherwise, the only way I found to get around this problem is to disable caching mode (Administer -> Site configuration -> Performance).
Comment #8
Patrick Nelson commentedI am having the same problem and would like to see the changes too. Subscribing so I can track this post.
Comment #9
psicomante commentedi've done recently the same patch for my jtooltips module. It is simply:
change your hovertip_menu in:
Comment #10
psicomante commentedops, the function calls hovertip_menu(), while you should delete also hovertip_init()
Comment #11
Dave Cohen commentedThanks for the help. This seems like a simple enough change, and I'll commit it when I can. I'm travelling and may not have a chance for a week or so...
Comment #12
Dave Cohen commentedI've checked in the attached patch. I was never able to reproduce the problem. Still I hope this will fix it.
Thanks for the advice.
Comment #13
(not verified) commentedComment #14
Anonymous (not verified) commentedI have got the same error in dropdown_menu.module on line 5:
Fatal error: Call to undefined function drupal_add_css() in /home/gaultmi/public_html/modules/dropdown_menu/dropdown_menu.module on line 5The funny thing is, this PHP error only occurs in FireFox! Not in IE. After refreshing FireFox 3-4 times, it does load. Then it goes back to the error again.
This is from dropdown_menu.module:
Any help?
Comment #15
Anonymous (not verified) commentedAlso, it only happens in FireFox, but only when CACHE is on NORMAL in admin/settings/performance. When I turn off cache, the error never occurs.
Comment #16
Dave Cohen commentedmxistance, from your comments, it sounds like your problem is with dropdown_menu.module. Are you also getting the same error with hovertips.module?
If not, please submit a new issue to the dropdown_menu issue queue, rather than opening a closed issue here. Thanks
Comment #17
suit4 commentedI would not say, that this is a problem of hovertips and clicktips, as it also occurs with the iconify.module, not having dropdown_menu.module or hovertips or clicktips installed.
By the way, this error did not occur with cache set to disabled, only if cache is set to normal. Further more, this error seems to be only appearing, when calling http://www.MyDomain.com/ . When calling http://www.MyDomain.com/index.php, the error does not occur.
I'll try to dig into iconify.module to find out more ....
Comment #18
suit4 commentedAs far as I can see it by now, drupal_add_css (or drupal_add_js) cannot be called reliably through both hook_init() or hook_menu() - if caching is set to normal.
That a reliable call to drupal_add_css() is not possible in hook_init() is already mentioned in hovertip module ....
Comment #19
Anonymous (not verified) commentedI think its unrelated to hovertip module itself.
But isn't it amazing PHP errors can occur differently by browser type? That's supposed to be impossible, yet this error never occurs in IE6-IE8, only in Safari/Firefox with cache set to Normal.
Comment #20
Dave Cohen commentedSounds like the browsers are making different requests of the server, based on their caching behavior. That would explain why the server does different things for different browsers.
Let me know if this is still an issue for hovertips. Sounds like its not.