Using Lightbox and Gallery2 does not work on a german Drupal6 and german Gallery2 installation. The issue however seems to be created by the lightbox2 module.
The error is that the disclosure indicators (see attached image) won't show and work anymore unless either Lightbox2 or Gallery2 are deactivated.
The debugger shows an error in the page header (parse error):
(broken)
jQuery.extend(Drupal.settings, { "basePath": "/", "admin_menu": { "margin_top": 1, "tweak_modules": 0 }, "lightbox2": { "rtl": "0", "file_path": "/(\\w\\w/)sites/default/files", "default_image": "/sites/default/modules/lightbox2/images/brokenimage.jpg", "border_size": 10, "font_color": "000", "box_color": "fff", "top_position": "", "overlay_opacity": 0,8, "overlay_color": "000", ...
VS
(working)
jQuery.extend(Drupal.settings, { "basePath": "/", "admin_menu": { "margin_top": 1, "tweak_modules": 0 }, "lightbox2": { "rtl": "0", "file_path": "/(\\w\\w/)sites/default/files", "default_image": "/sites/default/modules/lightbox2/images/brokenimage.jpg", "border_size": 10, "font_color": "000", "box_color": "fff", "top_position": "", "overlay_opacity": 0.8, "overlay_color": "000", ...
Notice the overlay_opacity value 0,8 vs 0.8! I don't know where to change the localized number formatting, but I hope this helps.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | overlay_opacity.patch | 1.01 KB | tracy_pilcher |
| error.jpg | 56.12 KB | ddauer |
Comments
Comment #1
Mr.Rox commentedi have the same problem
Comment #2
stella commentedwhat other modules do u have enabled?
Comment #3
stella commentedMarking as "won't fix" as no more information forthcoming. Please feel free to re-open if you can give me more information.
Cheers,
Stella
Comment #4
ij3net commentedI have the same problem in russian installtion. Using Lightbox2 only. Js debugger shows an error in the page header "invalid object initializer" on the
"lightbox2": { "rtl": "0", "file_path": "/(\\w\\w/)sites/default/files", "default_image": "/modules/lightbox2/images/brokenimage.jpg", "border_size": 10, "font_color": "000", "box_color": "fff", "top_position": "", "overlay_opacity": 0,8, "overlay_color": "000", "disable_close_click": true, "resize_sequence": 0, "resize_speed": 400, "fade_in_speed": 400, "slide_down_speed": 600, "use_alt_layout": false, "disable_resize": false, "disable_zoom": false, "force_show_nav": false, "loop_items": false, "node_link_text": "View Image Details", "node_link_target": false, "image_count": "Image !current of !total", "video_count": "Video !current of !total", "page_count": "Page !current of !total", "lite_press_x_close": "нажмите \x3ca href=\"#\" onclick=\"hideLightbox(); return FALSE;\"\x3e\x3ckbd\x3ex\x3c/kbd\x3e\x3c/a\x3e чтобы закрыть", "download_link_text": "Download Original", "enable_login": false, "enable_contact": false, "keys_close": "c x 27", "keys_previous": "p 37", "keys_next": "n 39", "keys_zoom": "z", "keys_play_pause": "32", "display_image_size": "", "image_node_sizes": "()", "trigger_lightbox_classes": "", "trigger_lightbox_group_classes": "", "trigger_slideshow_classes": "", "trigger_lightframe_classes": "", "trigger_lightframe_group_classes": "", "custom_class_handler": 0, "custom_trigger_classes": "", "disable_for_gallery_lists": true, "disable_for_acidfree_gallery_lists": true, "enable_acidfree_videos": true, "slideshow_interval": 5000, "slideshow_automatic_start": true, "slideshow_automatic_exit": true, "show_play_pause": true, "pause_on_next_click": false, "pause_on_previous_click": true, "loop_slides": false, "iframe_width": 600, "iframe_height": 400, "iframe_border": 1, "enable_video": false }
When i disable Lightbox2 all working. I'm using default Lightbox2 settings.
Comment #5
ij3net commentedThe problem is localized. Error caused by a peculiarity of the Russian locale. In the Russian locale for the fractional part separated by a comma, not point. As a result, violated the format of the initialization string. I solved the problem as follows:
// Load the javascript settings.
$js_settings = array(
//'overlay_opacity' => (float)variable_get('lightbox2_overlay_opacity', 0.8),
'overlay_opacity' => str_replace(',','.',(float)variable_get('lightbox2_overlay_opacity', 0.8)),
in the lightbox2.module
Comment #6
tracy_pilcher commentedIt's probably a good idea to incorporate this fix to the overlay_opacity percent in the module, since many countries use comma in the place of the period in floats, currency, etc. I will make the change, test it and commit it to the module if it works as expected.
Comment #7
tracy_pilcher commentedReplaced overlay_opacity array setting with the version recommended by ij3net so that module will be compatible with all localizations.
Comment #8
tracy_pilcher commentedclosing ticket.
Comment #9
pasqualleconverting to float is unnecessary
will have the same result as the previous patch.
here are some tests if you want to experiment with comma used as decimal separator:
also you may try the print function instead of var_dump..