Posted by eromba on May 3, 2009 at 4:53am
4 followers
Jump to:
| Project: | jQuery Lightbox |
| Version: | 6.x-1.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Issue Summary
Similar to #178364: path_to_theme() call breaking blocks page, the call to path_to_theme() in jlightbox_add() causes Drupal's site-off-line page to go completely un-themed. I believe this occurs because jlightbox_init() calls jlightbox_add(), and calls to theme functions in hook_init() are not supported.
See #219910: Calling theme function from hook_init() interferes with administration theme for more information.
To replicate:
- Enable the jQuery Lightbox module.
- Take your site off-line.
- Log out.
- You will be greeted by your site-off-line message in plain text, the page devoid of any theme/styling whatsoever.
The simple fix is to add an exception for when the site is off-line.
| Attachment | Size |
|---|---|
| jlightbox_maint_fix.patch | 866 bytes |
Comments
#1
Nice one!
#2
Committed to all branches. Thanks!
#3
Automatically closed -- issue fixed for 2 weeks with no activity.
#4
Actually, that's not enough. It helps with offline mode, but if you try to programmatically change current theme from your module in hook_init() updating $custom_theme variable, it is not going to work again (unless you fiddle with module weights).
In my opinion call to path_to_theme() should be ditched from there completely. If someone needs to override styles, it can be easily done through any of the already existing theme CSS files, no real need to load specific jlightbox.css, especially if it breaks the workflow...