Closed (fixed)
Project:
Greybox
Version:
5.x-1.1
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
5 Dec 2006 at 13:32 UTC
Updated:
2 Feb 2007 at 20:16 UTC
Jump to comment: Most recent file
Had a link with the class I configured on the greybox adminpage but nothing is happening...checked the source code of the webpage and the js and css of greybox isn't loading...tried to change to the default class which is greybox but nothing happens still.
tried on a fresh install of Drupal 5.0.beta2...and this is the first contrib module i installed.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | greybox_fix.patch.txt | 1.59 KB | Gurpartap Singh |
| #1 | greybox.patch | 1.14 KB | tom friedhof |
Comments
Comment #1
tom friedhof commentedThe js and css are not getting called on pages that do not contain any nodes. greybox_add_files() is being executed in a hook_nodeapi call, which only gets called when a node is loaded.
I moved the call to hook_menu so it's called on every page regardless if a node is called. I also added $maycache to hook_menu so the menu item for the greybox settings can be cached and not built everytime the page loads.
Comment #2
Gurpartap Singh commentedComment #3
tom friedhof commentedHello Gurpartap, I'm not sure the call needs to go in a hook_init hook. According to the API docs (http://api.drupal.org/api/HEAD/function/hook_init) you only want to put code in a hook_init when you want it to execute every time, even for cached pages. I thought it was best to put greybox_add_files() call in the hook_menu hook. Either way works. Let me know if I've misunderstood hook_init, or if this is just a matter of preference. Thanks.
Comment #4
Gurpartap Singh commentedGreetings :) Well I had just preferred to use hook_init() for now, although putting it into hook_menu() would be better as far it counts for performance! Will include this change within next release.
Comment #5
Gurpartap Singh commentedComment #6
Gurpartap Singh commentedMoved code to hook_menu(). Thanks!
Comment #7
(not verified) commented