10.10 milestone name corrupted in JS: 10.1
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | Launchpad itself |
Low
|
Colin Watson | ||
| | lazr.restful |
High
|
Unassigned | ||
Bug Description
Steps to reproduce:
1. In a series of a Launchpad sub-project (e.g. malone) create a milestone named 10.10.
2. Notice the error message "Could not retrieve milestone 10.10" in the Milestones and Releases table.
3. Refresh and the error becomes a link to a new 10.1 milestone, rather than 10.10.
See screen shot.
Related branches
- William Grant: Approve (code) on 2015-10-12
- Roberto Alsina (community): Approve on 2015-10-12
-
Diff: 25 lines (+3/-2)2 files modifiedlib/lp/app/javascript/client.js (+2/-1)
lib/lp/app/javascript/tests/test_lp_client.js (+1/-1)
| Matthew Revell (matthew.revell) wrote : | #1 |
| Curtis Hovey (sinzui) wrote : | #2 |
| Changed in launchpad-registry: | |
| importance: | Undecided → Low |
| status: | New → Triaged |
| milestone: | none → series-future |
| Curtis Hovey (sinzui) wrote : | #3 |
The problem is type conversion. Code names are strings, "10.10" is a string, but JS thinks it is a float, so it drops the 0.
maybe milestoneoverlay.js can do the string concatenation hack to ensure version is alwaysa string
code_name: data['field.
should be
code_name: '' + data['field.
| summary: |
- Can't create 10.10 milestone for Launchpad sub + 10.10 milestone name corrupted in JS: 10.1 |
| tags: | added: javascript |
| tags: | added: milestones |
| Barry Warsaw (barry) wrote : | #4 |
It's kind of icky, but I guess we'll just have to skip X.10 version numbers. I suppose this affects all X.Y0 versions.
| Marc Deslauriers (mdeslaur) wrote : | #5 |
FYI, I believe I worked around this issue by adding quotes when I entered the version number.
On Oct 09, 2013, at 03:53 PM, Marc Deslauriers wrote:
>FYI, I believe I worked around this issue by adding quotes when I
>entered the version number.
Indeed!
You'll get an error saying `Couldn't retrieve milestone "1.10"` but if you
refresh the page, the milestone sans quotes will be there just fine.
Thanks for the workaround.
| Curtis Hovey (sinzui) wrote : | #7 |
I had contemplated an alternate workaround on the backend. The script
will append "~~" and the backend always strips ~~.
| William Grant (wgrant) wrote : | #8 |
Or you can just middle-click the "Create milestone" link to navigate to the non-AJAX form, which isn't affected by the JS bug.
| William Grant (wgrant) wrote : | #9 |
The misbehaviour is caused by lazr.restful's SimpleFieldMars
| Changed in lazr.restful: | |
| importance: | Undecided → High |
| status: | New → Triaged |
| Changed in launchpad: | |
| assignee: | nobody → Colin Watson (cjwatson) |
| status: | Triaged → In Progress |
| Launchpad QA Bot (lpqabot) wrote : | #10 |
Fixed in stable r17815 <http://
| tags: | added: qa-needstesting |
| Changed in launchpad: | |
| status: | In Progress → Fix Committed |
| tags: |
added: qa-ok removed: qa-needstesting |
| Changed in launchpad: | |
| status: | Fix Committed → Fix Released |
| Colin Watson (cjwatson) wrote : | #11 |
This had to be rolled back a couple of times due to breaking other bits of JS and has now been reverted from trunk, so we'll need to fix those up and QA more thoroughly before re-landing this.
| Changed in launchpad: | |
| status: | Fix Released → In Progress |

Looks like the trailing '0' is lost between ajax and the form. The milestone is created as 10.1, which causes the error. The user can then rename the milestone. It is possible for this problem to create another error is the x.1 milestone already exists.