Closed (fixed)
Project:
Devel
Version:
5.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
10 Mar 2007 at 04:29 UTC
Updated:
6 Jul 2011 at 14:34 UTC
Jump to comment: Most recent file
Fatal error: Call to undefined function: drupal_add_js() in /home/xxx/public_html/sites/all/modules/devel/devel.module on line 166
also log showing sites/all/modules/devel/devel.css not found, even though it is there.
I have drupal 5.1, PHP 4.4.4, apache 1.3.37. only devel module enabled. not node access or macro.
My test machine running drupal 5.1, PHP 5.2, apache 1.3.33 does not have this error.
moving the devel folder out of the module folder allows login. also if logged in, and then logout you can use the back button to the user login and still login without having to move the devel folder.
thanks for all your hard work. this is a great module.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | devel_15.patch | 432 bytes | dave reid |
Comments
Comment #1
dave reidI'm guessing that since the annonymous users get cached versions, that some functions aren't available. When I added
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);to the beginning of the function devel_init() that anonymous browsing worked correctly. I've attached a patch but I haven't had time to investigate if there are any side-effects.Comment #2
dsp1 commentedright, I have Caching mode: Normal on the web site and Caching mode: Disabled on my test site.
I think I will wait to apply the patch to find out if there are any side effects.
thank you for your response.
Comment #3
laken commentedsubscribing
Comment #4
dave reidI'm very sure this is ready to commit. I haven't experienced any problems since the patch.
Comment #5
dwwi'm not so sure. take a look at http://drupal.org/node/123951 which is the issue that led to that call to drupal_add_js() being inserted in the first place. i think there might be cases when you break something by always doing a drupal_bootstrap() in hook_init() -- that seems totally wonky to me.
in fact, if you read http://api.drupal.org/api/5/function/hook_init you'll see that adding functions in hook_init() is generally prone to these errors, and when you get them, it recommends moving the offending code to hook_menu(), instead.
honestly, i don't fully understand the implications of #123951 enough to say for sure, but i'm *positive* this at least needs more review, if not more work, before it can be committed...
hopefully moshe and/or ted will reply here with their thoughts...
Comment #6
nicholasthompsonI've just upgraded www.thingy-ma-jig.co.uk to Drupal 5.1 and this bug was taking the entire site out for anon users. A suggestion by Mike Dixon was to use the user_access() function - so by wrapping the contents of devel_init() in a user_access() call like this...
... the error SEEMS to dissapear...
(I dont have diff facilities available right now)
Any thoughts on this?
Comment #7
nicholasthompsonignore me - this is not a fix... It took 10 minutes, but the page broke eventually.
Basically the same error as above.
Gonna try checking the global $user object...
Comment #8
nicholasthompsonMuch better solution (again suggested by Mike Dixon) is this:
That should nail it...
Comment #9
dwwmoshe just removed the line entirely (if you freshly update from CVS), since he didn't think the drupal_add_js() was essential to the other functionality and fixes addressed in http://drupal.org/node/123951
i just tested, and this is already fixed with the latest code (revision 1.106.4.41 of devel.module). with page caching enabled, 1.106.4.40 killed the site for anonymous, and 1.106.4.41 works fine.
Comment #10
dericknwq commentedWith that line removed, isn't JQuery not included at all? I've enabled viewing of devel information for anonymous user on my test site and that wouldn't work. I think the problem right now is getting Devel to work with the Cache (Normal) turned for Anonymous (with access "access devel information"). Or rather, Devel does not play well with Cache turned on at all.
Comment #11
(not verified) commented