I am working on debugging a site that I inherited from another developer. One of the issues is that the OpenLayers map was broken in Internet Explorer 8. When loading, the browser would display the following message:

Message: Arg: Fraction out of range (0 to 1 allowed)
Line: 2597
Char: 1
Code: 0
URI: http://openlayers.org/api/2.11/OpenLayers.js

After a while, I discovered that someone had set the fillOpacity in the style properties of a style to 2, despite the fact that the help text clearly states that "This should be a value between 0 and 1."

Perhaps we might add a validate function to ensure that this value is being set properly when the form is being filled out, or check that it is not greater than 1 when creating the map?

Files: 
CommentFileSizeAuthor
#7 1719598.patch1.13 KBPol
PASSED: [[SimpleTest]]: [MySQL] 238 pass(es). View
#6 1719598.patch1.13 KBPol
PASSED: [[SimpleTest]]: [MySQL] 238 pass(es). View
#4 1719598.patch1.09 KBPol
FAILED: [[SimpleTest]]: [MySQL] 238 pass(es), 0 fail(s), and 4 exception(s). View
#2 1719598.patch12.96 KBPol
FAILED: [[SimpleTest]]: [MySQL] Invalid patch format in 1719598.patch. View

Comments

Pol’s picture

Assigned: Unassigned » Pol

I take care of this.

Pol’s picture

Status: Active » Needs review
FileSize
12.96 KB
FAILED: [[SimpleTest]]: [MySQL] Invalid patch format in 1719598.patch. View

First shot of the patch.

Status: Needs review » Needs work

The last submitted patch, 1719598.patch, failed testing.

Pol’s picture

Status: Needs work » Needs review
FileSize
1.09 KB
FAILED: [[SimpleTest]]: [MySQL] 238 pass(es), 0 fail(s), and 4 exception(s). View

Status: Needs review » Needs work

The last submitted patch, 1719598.patch, failed testing.

Pol’s picture

Status: Needs work » Needs review
FileSize
1.13 KB
PASSED: [[SimpleTest]]: [MySQL] 238 pass(es). View
Pol’s picture

FileSize
1.13 KB
PASSED: [[SimpleTest]]: [MySQL] 238 pass(es). View

I made the patch without testing, if someone can test it, I can commit it tonight.

Pol’s picture

Status: Needs review » Fixed

Committed ! Thanks for the report !

I did not used the patch I made, I used the #element_validate property for elements in the form.

http://drupalcode.org/project/openlayers.git/commitdiff/f15b420?hp=48a73...

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.