Closed
Bug 340659
Opened 19 years ago
Closed 17 years ago
Import Bookmark's file in a folder feature doesn't work
Categories
(Firefox :: Bookmarks & History, defect)
Tracking
()
RESOLVED
INCOMPLETE
People
(Reporter: stef_fx, Unassigned)
Details
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4
There is an unused feature provided by nsBookmarksService::importBookmarks in nsBookmarksService.cpp.
I tried to use this feature without success after a lot of attempts.
I suspect there is a bug in doBookmarksCommand() from Bookmarks.js which made call of RDF.GetResource() or RDF.GetLiteral() before to BMDS.DoCommand(sourcesArray, rCommand, argsArray); Maybe these calls are not compatible with arguments waited by nsBookmarksService::importBookmarks.
Or there is a bug in nsBookmarksService::importBookmarks.
I am not a C++ developper so I don't know what is the problem, maybe it will be simple to investigate this problem.
To reproduce this problem add the following lines in bookmarks.js in function importBookmarksFromFile just after the catch(){}.
// Add following lines to select a folder where to put imported bookmarks
var rv = { selectedFolder: null };
openDialog("chrome://browser/content/bookmarks/addBookmark.xul", "",
"centerscreen,chrome,modal=yes,dialog=yes,resizable=yes", null,
null, null, null, "selectFolder", rv);
if (!rv.target) return; //If no folder is selected abort
var targetResource = rv.target.parent;
//targetResource = targetResource.QueryInterface(Components.interfaces.nsIRDFNode);
//------------
rTarget = RDF.GetResource("NC:BookmarksRoot");
RDFC.Init(BMDS, rTarget);
var countBefore = parseInt(BookmarksUtils.getProperty(rTarget, gRDF_NS+"nextVal"));
//Modify following line to add folder argument
//Original line: var args = [{ property: gNC_NS+"URL", literal: fileName}];
var args = [{ property: gNC_NS+"URL", literal: fileName, property: gNC_NS+"Folder", folder: targetResource}];
I tried to add/transform targetResource with QueryInterface, RDF.GetLiteral, ...
without success.
The JS error's message is always:
Error: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIRDFDataSource.DoCommand]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: chrome://browser/content/bookmarks/bookmarks.js :: anonymous :: line 379" data: no]
Source File: chrome://browser/content/bookmarks/bookmarks.js
Line: 379
What is the problem ? Is it really a bug or I made mistakes ?
Reproducible: Always
Reporter | ||
Updated•19 years ago
|
OS: Windows XP → All
Version: unspecified → 2.0 Branch
Comment 1•17 years ago
|
||
Bulk closing all UNCONFIRMED bugs dealing with places that haven't had any bug activity in over 120 days, have no votes, and are not enhancement requests.
If you are still experiencing this issue in Firefox 3.0 or later, please re-open the bug with steps to reproduce (if they were not part of the original comment).
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → INCOMPLETE
You need to log in
before you can comment on or make changes to this bug.
Description
•