Closed Bug 464767 Opened 16 years ago Closed 16 years ago

do not overwrite existing bookmarks if importBookmarksHTML is true but there's no bookmarks.html file

Categories

(Firefox :: Bookmarks & History, defect, P2)

defect

Tracking

()

RESOLVED FIXED
Firefox 3.1b2

People

(Reporter: dietrich, Assigned: mak)

References

Details

(Keywords: dataloss)

Attachments

(1 file, 4 obsolete files)

STR:

1. delete, move or rename bookmarks.html file in the profile directory
2. set the pref browser.places.importBookmarksHTML to true
3. restart

Expected: no changes. we should do nothing if the bookmarks.html file is not present

Actual: all bookmarks are deleted, and the default bookmarks are imported
notice actually browser.places.importBookmarksHTML is a pref the user has to create (in a new profile) and has to set by himself since we don't do that...

I was thinking that asking that the user could want to import the default... but yes, actually we also have restore_default_bookmarks.... so as you said is better to not do anything and set pref back to false.
Assignee: nobody → mak77
Blocks: 462366
marking as dataloss, i'm thinking to those users that had problems due to importBookmarksHTML set to true and now we could sweep away their bookmarks restoring the defaults.

actually since the patch is low risk i would like to take this followup for b2 if possible
Keywords: dataloss
Attached patch patch (obsolete) — Splinter Review
since dietrich is OOTO today asking review to mconnor, let's see if we can take this for b2 as a followup to importBookmarksHTML changes.

Previously when bookmarks.html did not exists we were importing the default bookmarks, but since the two preferences have clear requests (import or restore) we should not.

If the file does not exists we will catch the exception and report the error to the console.
Attachment #348172 - Flags: review?(mconnor)
Status: NEW → ASSIGNED
Target Milestone: --- → Firefox 3.1b2
Attachment #348172 - Flags: review?(mconnor) → review?(dietrich)
Comment on attachment 348172 [details] [diff] [review]
patch

moving back request to dietrich
Comment on attachment 348172 [details] [diff] [review]
patch

instead of needlessly getting the BMarks reference, please if/else here. also, if importBookmarksHTML is true, and the file doesn't exist, don't bother attempting to import at all.
Attachment #348172 - Flags: review?(dietrich) → review-
Priority: -- → P2
Attached patch patch (obsolete) — Splinter Review
do you want to differentiate case where default bookmarks.html does not exists? that would be an install/update issue though
Attachment #348172 - Attachment is obsolete: true
Attachment #348591 - Flags: review?(dietrich)
Comment on attachment 348591 [details] [diff] [review]
patch

no, but please report the missing file with Cu.reportError. also, declare bookmarksFile var outside the if/else for clarity.
Attachment #348591 - Flags: review?(dietrich) → review+
Attached patch patch (obsolete) — Splinter Review
fixed comments
Attachment #348591 - Attachment is obsolete: true
Attached patch patch (obsolete) — Splinter Review
Attachment #348625 - Attachment is obsolete: true
Comment on attachment 348626 [details] [diff] [review]
patch

asking approval to land in b2, as a followup to bug 462366, to avoid bookmarks lost.
Attachment #348626 - Flags: approval1.9.1b2?
Attached patch patchSplinter Review
minor cleanup to code style
Attachment #348626 - Attachment is obsolete: true
Attachment #348628 - Flags: approval1.9.1b2?
Attachment #348626 - Flags: approval1.9.1b2?
Blocks: 459377
Attachment #348628 - Flags: approval1.9.1b2? → approval1.9.1b2+
http://hg.mozilla.org/mozilla-central/rev/a730d0337646
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Depends on: 465933
Bug 451915 - move Firefox/Places bugs to Firefox/Bookmarks and History. Remove all bugspam from this move by filtering for the string "places-to-b-and-h".

In Thunderbird 3.0b, you do that as follows:
Tools | Message Filters
Make sure the correct account is selected. Click "New"
Conditions: Body   contains   places-to-b-and-h
Change the action to "Delete Message".
Select "Manually Run" from the dropdown at the top.
Click OK.

Select the filter in the list, make sure "Inbox" is selected at the bottom, and click "Run Now". This should delete all the bugspam. You can then delete the filter.

Gerv
Component: Places → Bookmarks & History
QA Contact: places → bookmarks
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: