Closed Bug 371673 Opened 17 years ago Closed 16 years ago

PlacesUtils.nodeIsReadonly is not reliable for history queries

Categories

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

defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: asaf, Assigned: asaf)

References

Details

Attachments

(1 file)

I found this while working on bug 371669.

PlacesUtils.nodeIsReadonly is not reliable for history queries:

  nodeIsReadOnly: function PU_nodeIsReadOnly(aNode) {
    NS_ASSERT(aNode, "null node");

    if (this.nodeIsFolder(aNode))
      return this.bookmarks.getFolderReadonly(asFolder(aNode).folderId);
    if (this.nodeIsQuery(aNode))
      return asQuery(aNode).childrenReadOnly;
    return false;
  },

childrenReadOnly is in nsINavHistoryContainerResultNode, so the node has to be queried as a container first.
test case?
Attached patch patchSplinter Review
Assignee: nobody → mano
Status: NEW → ASSIGNED
Attachment #256410 - Flags: review?(sspitzer)
Priority: -- → P2
Target Milestone: --- → Firefox 3 alpha3
(In reply to comment #1)
> test case?

Might be kinda hard, you need to make sure no other method queries the node as a container (say hello to XPConnect magic).
Comment on attachment 256410 [details] [diff] [review]
patch

r=sspitzer, sorry for the delay.

but a quick double check of something:

> childrenReadOnly is in nsINavHistoryContainerResultNode, so the node has to be
queried as a container first.

it is also part of nsIRemoteContainer  (see http://lxr.mozilla.org/seamonkey/source/toolkit/components/places/public/nsIRemoteContainer.idl#146 )

but your patch will work because the way nodeIsContainer() is implemented (see http://lxr.mozilla.org/seamonkey/source/browser/components/places/content/utils.js#277) right?
Attachment #256410 - Flags: review?(sspitzer) → review+
Target Milestone: Firefox 3 alpha3 → Firefox 3 M10
Target Milestone: Firefox 3 M10 → Firefox 3 M11
Target Milestone: Firefox 3 beta3 → ---
fixed in bug 419731.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → WORKSFORME
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: