Closed
Bug 405237
Opened 18 years ago
Closed 18 years ago
deleting "Unfiled Bookmarks" or "bookmarks menu" folders breaks places organizer (should be undeletable)
Categories
(Firefox :: Bookmarks & History, defect, P1)
Firefox
Bookmarks & History
Tracking
()
VERIFIED
FIXED
Firefox 3 beta2
People
(Reporter: JasnaPaka, Assigned: mak)
References
Details
(Keywords: dataloss)
Attachments
(4 files, 2 obsolete files)
|
1.84 KB,
patch
|
dietrich
:
review+
|
Details | Diff | Splinter Review |
|
1.74 KB,
patch
|
Details | Diff | Splinter Review | |
|
2.12 KB,
patch
|
Details | Diff | Splinter Review | |
|
1.79 KB,
patch
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9b2pre) Gecko/2007112405 Minefield/3.0b2pre
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9b2pre) Gecko/2007112405 Minefield/3.0b2pre
Firefox Trunk, clean profile.
Reproducible: Always
Steps to Reproduce:
1. Start Firefox and go to Bookmarks -> Show All Bookmarks.
2. In tree on left side try delete "Unfiled Bookmarks" via context menu option.
3. Close Places Organizer.
4. Open Places Organizer again and try to expand folder "All Bookmarks" in tree on left side.
5. Nothing happens.
Actual Results:
Cannot expand folder "All Bookmarks". In Error Console I have sometimes errors:
Error: uncaught exception: [Exception... "Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsINavHistoryService.executeQuery]" nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)" location: "JS frame :: chrome://browser/content/places/utils.js :: PU_getFolderContents :: line 876" data: no]
Error: uncaught exception: [Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsINavHistoryContainerResultNode.childCount]" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: chrome://browser/content/places/utils.js :: PU_getURLsForContainerNode :: line 1526" data: no]
Error: uncaught exception: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsINavBookmarksService.getItemTitle]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: chrome://browser/content/places/editBookmarkOverlay.js :: EIO__initFolderMenuList :: line 213" data: no]
Expected Results:
No error.
| Assignee | ||
Comment 1•18 years ago
|
||
confirmed, this happens also if you try to delete the Bookmarks Menu folder, it deletes all the contents and then All bookmarks does not work anymore.
marking as dataloss and asking blocking since this can corrupt a profile and a user can lost all unfiled bookmarks/boockmark menu
Those items should not be detable, possible patch coming (don't know if it's the right place to fix this, it feels like it is)
we could also add some check to the delete functions in places (or directly into the query) to be sure that nothing can call a delete on a bookmark root.
Severity: normal → major
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: dataloss
Version: unspecified → Trunk
| Assignee | ||
Comment 2•18 years ago
|
||
this adds check to controller.js
Attachment #290167 -
Flags: review?(mano)
| Assignee | ||
Updated•18 years ago
|
Flags: blocking-firefox3?
Summary: Deletation Unfiled Bookmarks in Places Organizer breaks Places → Unfiled Bookmarks should not be deletable in Places Organizer (or it will break the organizer)
| Assignee | ||
Updated•18 years ago
|
Summary: Unfiled Bookmarks should not be deletable in Places Organizer (or it will break the organizer) → "Unfiled Bookmarks" folder should not be deletable in Places Organizer (or it will break the organizer)
| Assignee | ||
Updated•18 years ago
|
Summary: "Unfiled Bookmarks" folder should not be deletable in Places Organizer (or it will break the organizer) → deleting "Unfiled Bookmarks" or "bookmarks menu" folders breaks places organizer (should be undeletable)
Updated•18 years ago
|
Assignee: nobody → mano
Flags: blocking-firefox3? → blocking-firefox3+
Priority: -- → P1
| Assignee | ||
Comment 4•18 years ago
|
||
an additional check can be added in deletes from moz_bookmarks, so we are sure that nothing can delete the roots
Updated•18 years ago
|
Whiteboard: [has patch][need review mano]
Updated•18 years ago
|
Target Milestone: --- → Firefox 3 M11
| Assignee | ||
Comment 6•18 years ago
|
||
Dietrich, do you think that the second patch (on queries) could be useful or is a bad idea to lock a delete query?
the worst case is if something needs to delete a root to change or re-create it, but in that case it should create the new root, update the folder_id to the new and then delete the old one (it's no more a root so it will be succesfully deleted)...
if you think that could be checked-in as an additional check, it will need your review too
Comment 7•18 years ago
|
||
Comment on attachment 290167 [details] [diff] [review]
don't delete unfiled bookmarks and bookmarks menu in the places organizer
>Index: browser/components/places/content/controller.js
>===================================================================
>RCS file: /cvsroot/mozilla/browser/components/places/content/controller.js,v
>retrieving revision 1.186
>diff -u -8 -p -r1.186 controller.js
>--- browser/components/places/content/controller.js 20 Nov 2007 19:06:31 -0000 1.186
>+++ browser/components/places/content/controller.js 26 Nov 2007 01:35:11 -0000
>@@ -273,25 +273,31 @@ PlacesController.prototype = {
> */
> _hasRemovableSelection: function PC__hasRemovableSelection(aIsMoveCommand) {
> if (!this._view.hasSelection)
> return false;
>
> var nodes = this._view.getSelectionNodes();
> var root = this._view.getResultNode();
>
>+ var bmFolderId = PlacesUtils.bookmarksMenuFolderId;
>+ var ubFolderId = PlacesUtils.unfiledBookmarksFolderId;
> var btFolderId = PlacesUtils.toolbarFolderId;
>+
nit: whitespace
> for (var i = 0; i < nodes.length; ++i) {
> // Disallow removing the view's root node
> if (nodes[i] == root)
> return false;
>
> // Disallow removing the toolbar folder
> if (!aIsMoveCommand &&
>- PlacesUtils.nodeIsFolder(nodes[i]) && nodes[i].itemId == btFolderId)
>+ PlacesUtils.nodeIsFolder(nodes[i]) &&
>+ (nodes[i].itemId == btFolderId ||
nit: whitespace on previous 2 lines
Attachment #290167 -
Flags: review?(mano) → review+
Comment 8•18 years ago
|
||
(In reply to comment #6)
> Dietrich, do you think that the second patch (on queries) could be useful or is
> a bad idea to lock a delete query?
> the worst case is if something needs to delete a root to change or re-create
> it, but in that case it should create the new root, update the folder_id to the
> new and then delete the old one (it's no more a root so it will be succesfully
> deleted)...
> if you think that could be checked-in as an additional check, it will need your
> review too
>
i'm not sure how tight we want to enforce this on the backend, due to non-fx toolkit consumers. lets wait on that, reconsider it for M11.
Updated•18 years ago
|
Assignee: mano → mak77
Comment 9•18 years ago
|
||
Checking in browser/components/places/content/controller.js;
/cvsroot/mozilla/browser/components/places/content/controller.js,v <-- controller.js
new revision: 1.188; previous revision: 1.187
done
marking fixed. will file a followup for considering back-end restriction.
Status: NEW → RESOLVED
Closed: 18 years ago
OS: Windows Vista → All
Hardware: PC → All
Resolution: --- → FIXED
Whiteboard: [has patch][need review mano]
Comment 10•18 years ago
|
||
(In reply to comment #9)
>
> marking fixed. will file a followup for considering back-end restriction.
>
filed bug 406886
Comment 11•18 years ago
|
||
This calls GetItemId trice for every node in the selection :-/
| Assignee | ||
Comment 12•18 years ago
|
||
Mano, should that be fixed assigning nodes[i].itemId to a var and checking on that? I thought that itemId was a node property
| Assignee | ||
Comment 13•18 years ago
|
||
this fixes a comment and Mano's comment
Attachment #291633 -
Flags: review?(mano)
Comment 14•18 years ago
|
||
Comment on attachment 291633 [details] [diff] [review]
Supplimental perf fix
>Index: browser/components/places/content/controller.js
>===================================================================
>RCS file: /cvsroot/mozilla/browser/components/places/content/controller.js,v
>retrieving revision 1.188
>diff -u -8 -p -r1.188 controller.js
>--- browser/components/places/content/controller.js 5 Dec 2007 00:11:00 -0000 1.188
>+++ browser/components/places/content/controller.js 5 Dec 2007 10:29:46 -0000
>@@ -275,29 +275,29 @@ PlacesController.prototype = {
> if (!this._view.hasSelection)
> return false;
>
> var nodes = this._view.getSelectionNodes();
> var root = this._view.getResultNode();
>
> var bmFolderId = PlacesUtils.bookmarksMenuFolderId;
> var ubFolderId = PlacesUtils.unfiledBookmarksFolderId;
>- var btFolderId = PlacesUtils.toolbarFolderId;
>-
>+ var btFolderId = PlacesUtils.toolbarFolderId;
>+
new trailing spaces.
> for (var i = 0; i < nodes.length; ++i) {
> // Disallow removing the view's root node
> if (nodes[i] == root)
> return false;
>
>- // Disallow removing the toolbar folder
>+ // Disallow removing the toolbar, menu, unfiled folders
more trailing space; also, please change that to "Disallow removing the toolbar, menu and unfiled-bookmarks folders"
r=mano otherwise.
Attachment #291633 -
Flags: review?(mano) → review+
Comment 15•18 years ago
|
||
FWIW, you can remove the three variables:
var bmFolderId = PlacesUtils.bookmarksMenuFolderId;
var ubFolderId = PlacesUtils.unfiledBookmarksFolderId;
var btFolderId = PlacesUtils.toolbarFolderId;
and use PlacesUtils directly
| Assignee | ||
Comment 16•18 years ago
|
||
fixed comments, this is ready for checkin
Attachment #291633 -
Attachment is obsolete: true
| Assignee | ||
Updated•18 years ago
|
Keywords: checkin-needed
Comment 17•18 years ago
|
||
Checking in browser/components/places/content/controller.js;
/cvsroot/mozilla/browser/components/places/content/controller.js,v <-- controller.js
new revision: 1.189; previous revision: 1.188
done
Keywords: checkin-needed
Comment 18•18 years ago
|
||
(In reply to comment #16)
> Created an attachment (id=291648) [details]
> fix Mano's comments
the spaces mentioned by dietrich and mano are still there ...
| Assignee | ||
Comment 19•18 years ago
|
||
i thought they were referring to lines with useless spacing like:
>+
that were fixed
other lines are following previous code lining and other code i found in the same file. could you explain please? thank you Dao
| Assignee | ||
Comment 20•18 years ago
|
||
i get it, thank you Dao, Sorry Reed for double work (will check spaces till now)
| Assignee | ||
Updated•18 years ago
|
Keywords: checkin-needed
| Assignee | ||
Comment 21•18 years ago
|
||
Attachment #291869 -
Attachment is obsolete: true
Comment 22•18 years ago
|
||
Checking in browser/components/places/content/controller.js;
/cvsroot/mozilla/browser/components/places/content/controller.js,v <-- controller.js
new revision: 1.190; previous revision: 1.189
done
Keywords: checkin-needed
Comment 23•18 years ago
|
||
I still cannot expand folder "All Bookmarks"
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b2pre) Gecko/2007120705 Minefield/3.0b2pre
| Assignee | ||
Comment 24•18 years ago
|
||
this bug cannot un-corrupt corrupted profiles, it is to avoid that it can happen
Comment 25•18 years ago
|
||
Verified fix on Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9b2) Gecko/2007121014 Firefox/3.0b2. "Unfiled bookmarks" and "Bookmarks menu" cannot be deleted from places organizer or Bookmarks Sidebar.
Status: RESOLVED → VERIFIED
Comment 26•16 years ago
|
||
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.
Description
•