Closed Bug 457777 Opened 17 years ago Closed 16 years ago

bookmark items in distribution.ini are not added if the item number has more than one digit

Categories

(Firefox :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 3.7a1
Tracking Status
blocking1.9.2 --- -
status1.9.2 --- .2-fixed
blocking1.9.1 --- -
status1.9.1 --- .9-fixed

People

(Reporter: kev, Assigned: kev)

Details

Attachments

(2 files, 1 obsolete file)

Bookmark items with an id number of two digits or more are ignored by the distribution.js module. Bookmark items with an id number of one digit are parsed and added properly. The issue applies to both bookmark toolbar entries and bookmark menu entries. Attached is a sample distribution.ini file that contains three bookmark toolbar items, one with an item number of "1", one with an item number of "10", and one with an item number of "100". Only the bookmark with an item number of "1" is added to the toolbar.
because Gavin is awesome, he pointed out to me today that there was a string vs. int comparison issue. editing line 157 of distribution.js such that it reads: if (maxItemId < parseInt(iid)) seems to do the trick nicely. thunder, could you have a look and verify that's all that needs to be done to the file?
Comment on attachment 425119 [details] [diff] [review] Patch to ensure iid comparison is int to int Holy cow, I'd forgotten about this bug. Indeed, interpreting those as strings would be trouble. I didn't realize that /(\d+)/ would end up giving me a string (boo). I just skimmed distribution.js: http://mxr.mozilla.org/mozilla-central/source/browser/components/distribution.js?force=1 And it looks like the only instance of this bug there. r+ as far as I'm concerned
Attachment #425119 - Flags: review+
Excellent. Need this added to 1.9.1, 1.9.2, and Central. Who should be cc'd for review and landing?
(In reply to comment #3) > Excellent. Need this added to 1.9.1, 1.9.2, and Central. Who should be cc'd for > review and landing? you already have review. i can land this on central, then you just need to ask approvals.
Assignee: nobody → kev
Status: NEW → ASSIGNED
That'd be great, Marco. Thanks.
http://hg.mozilla.org/mozilla-central/rev/ff46fa92babd once got a green you're clear to ask approval for branches.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 3.7a1
Thanks Marco!
Attachment #425119 - Flags: approval1.9.2.2?
Attachment #425119 - Flags: approval1.9.1.9?
Comment on attachment 425119 [details] [diff] [review] Patch to ensure iid comparison is int to int Hmm, actually, this patch isn't quite ideal, since iid is still being assigned to maxItemId as a string, so you're still relying on implicit conversion (just in the opposite direction - maxItemId to an int). Would be cleaner to just set iid = parseInt(iid) right after it's assigned to, I think.
Attachment #425119 - Flags: approval1.9.2.2?
Attachment #425119 - Flags: approval1.9.1.9?
Per Gavin's comment #8, revised the patch to set iid = parseInt(iid) after assignment.
Attachment #425119 - Attachment is obsolete: true
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Marco, can you back out the old patch?
(In reply to comment #10) > Marco, can you back out the old patch? I'll undo the previous change once i push the new patch, in a single push.
Attachment #425437 - Flags: review+
Status: REOPENED → RESOLVED
Closed: 16 years ago16 years ago
Resolution: --- → FIXED
Asking for acceptance into 1.9.1.next and 1.9.2.next, as it addresses a long-standing bug with existing partner repacks that have more than 10 items in a bookmark folder as part of their customizations. Would also like to ensure this is included in any future releases. Thanks!
blocking1.9.1: --- → ?
blocking1.9.2: --- → ?
Definitely wanted; if those patches are safe, can we get them nominated for the appropriate branches?
blocking1.9.1: ? → -
blocking1.9.2: ? → -
Comment on attachment 425437 [details] [diff] [review] Revised update to address comment #8 Yes, the patch is safe enough, just a string->int cast.
Attachment #425437 - Flags: approval1.9.2.2?
Attachment #425437 - Flags: approval1.9.1.9?
Comment on attachment 425437 [details] [diff] [review] Revised update to address comment #8 a=beltzner for 1.9.2 and 1.9.1
Attachment #425437 - Flags: approval1.9.2.2?
Attachment #425437 - Flags: approval1.9.2.2+
Attachment #425437 - Flags: approval1.9.1.9?
Attachment #425437 - Flags: approval1.9.1.9+
Keywords: checkin-needed
Whiteboard: [c-n: 191, 192]
Marco: can you check this into the branches?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: