Closed Bug 1182434 Opened 9 years ago Closed 8 years ago

Bookmark restoration doesn't work when exported file has uppercase extension.

Categories

(SeaMonkey :: Bookmarks & History, defect)

defect
Not set
normal

Tracking

(firefox42 affected)

RESOLVED FIXED
seamonkey2.42
Tracking Status
firefox42 --- affected

People

(Reporter: arai, Assigned: sabergeass, Mentored)

Details

(Whiteboard: [good first bug][lang=js])

Attachments

(1 file)

This should be same bug as firefox's bug 558566.

Steps to reproduce
  1. Open Bookmarks Manager
  2. Choose menu [Tools]-[Backup...] and save as test.JSON
  3. Choose menu [Tools]-[Restore]-[Choose File...] and choose test.JSON

Actual result:
  "Unsupported file type." alert is shown

Expected result:
  bookmark is restored from test.JSON

This is caused by following line:
https://dxr.mozilla.org/comm-central/source/suite/common/bookmarks/bookmarksManager.js#428
>     if (!/\.json(?:lz4)?$/.test(aFile.leafName)) {
>       this._showErrorAlert(PlacesUIUtils.getString("bookmarksRestoreFormatError"));
>       return;
>     }
it should check extension as case-insensitive.
I'm going to label this as [good first bug]. Required code change should be simple:
  * Support JSON or JSONLZ4 file with uppercase (or mixed case) extension in restoreBookmarksFromFile function [1]

You'll need basic knowledge of JavaScript, and be able to build and test SeaMonkey [2].

A skilled first-time contributor should be able to finish this in two weeks. Leave comments / questions here, or ask me (:arai) in IRC #introduction and #seamonkey channels.
Note that I'm not a module peer, so I'll finally forward review request to appropriate reviewer :)

[1] https://hg.mozilla.org/comm-central/file/a77e7b1551c9/suite/common/bookmarks/bookmarksManager.js#l426
[2] https://developer.mozilla.org/en-US/docs/Simple_SeaMonkey_build
Mentor: arai.unmht
Whiteboard: [good first bug][lang=js]
(In reply to Tooru Fujisawa [:arai] from comment #1)
> I'm going to label this as [good first bug]. Required code change should be
> simple:
>   * Support JSON or JSONLZ4 file with uppercase (or mixed case) extension in
> restoreBookmarksFromFile function [1]
> 
> You'll need basic knowledge of JavaScript, and be able to build and test
> SeaMonkey [2].
> 
> A skilled first-time contributor should be able to finish this in two weeks.
> Leave comments / questions here, or ask me (:arai) in IRC #introduction and
> #seamonkey channels.
> Note that I'm not a module peer, so I'll finally forward review request to
> appropriate reviewer :)
> 
> [1]
> https://hg.mozilla.org/comm-central/file/a77e7b1551c9/suite/common/bookmarks/
> bookmarksManager.js#l426
> [2] https://developer.mozilla.org/en-US/docs/Simple_SeaMonkey_build

Hi Tooru, I would like to work on this bug. Could you assign it to me if it's ok? Thank you :)
(In reply to MikeLing from comment #2)
> Hi Tooru, I would like to work on this bug. Could you assign it to me if
> it's ok? Thank you :)

Hi, thank you for your interest.  I'll assign this bug to you when you post a patch ;)
WIP patch is also okay.
(because, sadly, there are/were so much assigned-but-abandoned good-first-bugs, which makes it hard to find available one.  posting a comment will be sufficient to tell others that you're working on this right now)

If you have any question regarding this bug, or preparing building environment, feel free to ask here or ask me (:arai) in IRC.
(In reply to Tooru Fujisawa [:arai] from comment #3)

totally understand :)

honestly, I'm not good at commit PR by hg. But I will try my best on it. Thank you for your trusty :)
Already test it on locally, :)
Attachment #8657997 - Flags: review?(arai.unmht)
Assignee: nobody → sabergeass
Comment on attachment 8657997 [details] [diff] [review]
patch_for_bug1182434.patch

Review of attachment 8657997 [details] [diff] [review]:
-----------------------------------------------------------------

Thank you for your patch.
It looks perfect!  I'd forward review request to module peer.
Attachment #8657997 - Flags: review?(iann_bugzilla)
Attachment #8657997 - Flags: review?(arai.unmht)
Attachment #8657997 - Flags: feedback+
Status: NEW → ASSIGNED
Attachment #8657997 - Flags: review?(iann_bugzilla) → review+
Keywords: checkin-needed
Pushed http://hg.mozilla.org/comm-central/rev/3789444acc85
Keywords: checkin-needed
Target Milestone: --- → Future
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: Future → seamonkey2.42
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: