Not working at all in locales using comma for decimal point

fliegermaus - October 25, 2009 - 16:10
Project:Lightbox2
Version:6.x-1.9
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

Initial value for the variable ''lightbox2_overlay_opacity' is 0.8 - notice lack of quotes, it is a floating point number.

When rendered as JavaScript (in Drupal.settings) in a Polish locale, this number is written out as 0,8 - please notice the comma. This comma totally breaks the { } construct in JavaScript. This will happen in any locale that uses a comma as the decimal point.

One fix is simply opening the settings page (admin/settings/lightbox2) and clicking the submit button, which will save said variable as "0.8".

If we want lightbox2 working right out of the box, the 'lightbox2_overlay_opacity' variable should be initialized to be a string.

Patch for the lightbox2.module file is attached.

AttachmentSize
lightbox2.module.patch724 bytes

#1

fliegermaus - October 25, 2009 - 16:11
Priority:critical» normal

#2

fliegermaus - October 25, 2009 - 19:22

Seems like the problem is rooted much deeper than lightbox itself.

http://drupal.org/node/614124

 
 

Drupal is a registered trademark of Dries Buytaert.