eric-bixby / auto-sort-bookmarks-webext

Firefox add-on to sort bookmarks by multiple criteria
GNU General Public License v3.0
113 stars 21 forks source link

Sorting does not work at all #7

Closed V1c70r closed 9 years ago

V1c70r commented 9 years ago

After click at "Bookmarks"->"Sort Bookmarks" nothing happens. The hot key does not work. Auto-sorting does not work too. Auto-sort-bookmarks 2.5, Firefox 33.0. The error from the browser console: TypeError: bookmark1[BookmarkSorter.prototype.firstSortCriteria] is null Stack trace: BookmarkSorter<.compare@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///home/victor/.mozilla/firefox/acrwa2cn.default/extensions/wappalyzer@crunchlabz.com.xpi!/bootstrap.js -> resource://gre/modules/commonjs/toolkit/loader.js -> resource://sortbookmarks-at-bouanto/autosortbookmarks/lib/bookmark-sorter.js:54:13 BookmarkSorter<.sortFolder@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///home/victor/.mozilla/firefox/acrwa2cn.default/extensions/wappalyzer@crunchlabz.com.xpi!/bootstrap.js -> resource://gre/modules/commonjs/toolkit/loader.js -> resource://sortbookmarks-at-bouanto/autosortbookmarks/lib/bookmark-sorter.js:158:13 BookmarkSorter<.sortAndSave@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///home/victor/.mozilla/firefox/acrwa2cn.default/extensions/wappalyzer@crunchlabz.com.xpi!/bootstrap.js -> resource://gre/modules/commonjs/toolkit/loader.js -> resource://sortbookmarks-at-bouanto/autosortbookmarks/lib/bookmark-sorter.js:138:13 BookmarkSorter<.sortFolders/this.thread<@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///home/victor/.mozilla/firefox/acrwa2cn.default/extensions/wappalyzer@crunchlabz.com.xpi!/bootstrap.js -> resource://gre/modules/commonjs/toolkit/loader.js -> resource://sortbookmarks-at-bouanto/autosortbookmarks/lib/bookmark-sorter.js:195:25 Thread<.execute@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///home/victor/.mozilla/firefox/acrwa2cn.default/extensions/wappalyzer@crunchlabz.com.xpi!/bootstrap.js -> resource://gre/modules/commonjs/toolkit/loader.js -> resource://sortbookmarks-at-bouanto/autosortbookmarks/lib/thread.js:35:44 Thread<.execute/<@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///home/victor/.mozilla/firefox/acrwa2cn.default/extensions/wappalyzer@crunchlabz.com.xpi!/bootstrap.js -> resource://gre/modules/commonjs/toolkit/loader.js -> resource://sortbookmarks-at-bouanto/autosortbookmarks/lib/thread.js:37:17 notify@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/timers.js:40:9 exports.Utils.yield@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///home/victor/.mozilla/firefox/acrwa2cn.default/extensions/%7Bd10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d%7D.xpi!/bootstrap.js -> jar:file:///home/victor/.mozilla/firefox/acrwa2cn.default/extensions/%7Bd10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d%7D.xpi!/lib/utils.js:380:12 INIParser.prototype.process@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///home/victor/.mozilla/firefox/acrwa2cn.default/extensions/%7Bd10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d%7D.xpi!/bootstrap.js -> jar:file:///home/victor/.mozilla/firefox/acrwa2cn.default/extensions/%7Bd10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d%7D.xpi!/lib/filterStorage.js:870:7 exports.IO.readFromFile/onProgress@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///home/victor/.mozilla/firefox/acrwa2cn.default/extensions/%7Bd10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d%7D.xpi!/bootstrap.js -> jar:file:///home/victor/.mozilla/firefox/acrwa2cn.default/extensions/%7Bd10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d%7D.xpi!/lib/io.js:97:15 exports.IO.readFromFile/<@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///home/victor/.mozilla/firefox/acrwa2cn.default/extensions/%7Bd10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d%7D.xpi!/bootstrap.js -> jar:file:///home/victor/.mozilla/firefox/acrwa2cn.default/extensions/%7Bd10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d%7D.xpi!/lib/io.js:185:13 TaskImpl_run@resource://gre/modules/Task.jsm:330:41 Handler.prototype.process@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:866:23 this.PromiseWalker.walkerLoop@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:745:7

V1c70r commented 9 years ago

I return to version 2.3. It works correctly.

V1c70r commented 9 years ago

2.3 doesn't work too. Screw you guys, I'm going Chrome!

digitalcircuit commented 9 years ago

Using the latest version from the Mozilla Addons site (2.7.1), I run into a similar issue. Bookmarks and folders will not sort after clicking "Sort Bookmarks" in in the Bookmarks menu. After investigating the local addon .xpi in my Firefox profile, it appears that the problematic code is in bookmark-sorter.js on line 85

19:48:16.236 TypeError: bookmark1[BookmarkSorter.prototype.firstSortCriteria] is null
Stack trace:
BookmarkSorter<.compare@resource://gre/modules/commonjs/toolkit/loader.js -> resource://sortbookmarks-at-bouanto/autosortbookmarks/lib/bookmark-sorter.js:54:13
BookmarkSorter<.sortFolder@resource://gre/modules/commonjs/toolkit/loader.js -> resource://sortbookmarks-at-bouanto/autosortbookmarks/lib/bookmark-sorter.js:158:13
BookmarkSorter<.sortAndSave@resource://gre/modules/commonjs/toolkit/loader.js -> resource://sortbookmarks-at-bouanto/autosortbookmarks/lib/bookmark-sorter.js:138:13
BookmarkSorter<.sortFolders/this.thread<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://sortbookmarks-at-bouanto/autosortbookmarks/lib/bookmark-sorter.js:195:25
Thread<.execute@resource://gre/modules/commonjs/toolkit/loader.js -> resource://sortbookmarks-at-bouanto/autosortbookmarks/lib/thread.js:35:44
Thread<.execute/<@resource://gre/modules/commonjs/toolkit/loader.js -> resource://sortbookmarks-at-bouanto/autosortbookmarks/lib/thread.js:37:17
notify@resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/timers.js:40:9
waitForSyncCallback@resource://services-common/async.js:102:7
querySpinningly@resource://services-common/async.js:201:12
GUIDForId@resource://gre/modules/services-sync/engines/bookmarks.js:1162:18
BStore_getChildren@resource://gre/modules/services-sync/engines/bookmarks.js:1241:1
BStore_getChildren@resource://gre/modules/services-sync/engines/bookmarks.js:1242:11
BStore_getChildren@resource://gre/modules/services-sync/engines/bookmarks.js:1242:11
BStore_getChildren@resource://gre/modules/services-sync/engines/bookmarks.js:1242:11
BStore_getAllIDs@resource://gre/modules/services-sync/engines/bookmarks.js:1301:9
_buildGUIDMap@resource://gre/modules/services-sync/engines/bookmarks.js:246:22
_syncStart/<@resource://gre/modules/services-sync/engines/bookmarks.js:390:19
_mapDupe@resource://gre/modules/services-sync/engines/bookmarks.js:330:9
_createRecord@resource://gre/modules/services-sync/engines/bookmarks.js:430:17
SyncEngine.prototype._uploadOutgoing@resource://services-sync/engines.js:1451:21
SyncEngine.prototype._sync@resource://services-sync/engines.js:1522:7
wrappedSync@resource://gre/modules/services-sync/engines/bookmarks.js:229:11
_sync@resource://gre/modules/services-sync/engines/bookmarks.js:226:1
WrappedNotify@resource://services-sync/util.js:148:21
Engine.prototype.sync@resource://services-sync/engines.js:668:5
_syncEngine@resource://services-sync/stages/enginesync.js:199:7
sync@resource://services-sync/stages/enginesync.js:149:15
onNotify@resource://gre/modules/services-sync/service.js:1295:7
WrappedNotify@resource://services-sync/util.js:148:21
WrappedLock@resource://services-sync/util.js:103:16
_lockedSync@resource://gre/modules/services-sync/service.js:1285:12
sync/<@resource://gre/modules/services-sync/service.js:1277:14
WrappedCatch@resource://services-sync/util.js:77:16
sync@resource://gre/modules/services-sync/service.js:1265:5
1 timers.js:43
digitalcircuit commented 9 years ago

Aha! It seems Auto-Sort Bookmarks breaks whenever the "title" (or whatever is chosen as sort criteria) of a bookmark is null, e.g. the "Name" field in the Firefox bookmarks manager has no content. I found this by setting a conditional breakpoint in bookmark-sorter.js on line 85, with the condition of bookmark1[BookmarkSorter.prototype.firstSortCriteria] == null.

There needs to be a check for null values. If found, that should result in either comparing by URL or skipping doing anything with the bookmark at all. I don't think this is supposed to be able to happen as Firefox automatically filled in the "title" of the bookmarks whenever I opened the URLs in a new tab from the bookmark manager.

In the meantime, you can work around the problem by setting the conditional breakpoint above to find the broken bookmarks, then filling in the "Name" field on any that are missing it. You may have to enable Add-on Debugging by doing the following: open the developer tools, go to the settings and enable chrome debugging and remote debugging. Once they are on you can find debug buttons for add-ons in the Add-ons Manager.

After correcting 7 or so corrupted bookmarks, Auto-Sort Bookmarks works once again!

Gitoffthelawn commented 9 years ago

Nice job!

antoyo commented 9 years ago

Fixed in version 2.8.