diff --git a/browser/components/places/src/nsPlacesTransactionsService.js b/browser/components/places/src/nsPlacesTransactionsService.js index ea824dd7a7d..715902d0fa7 100644 --- a/browser/components/places/src/nsPlacesTransactionsService.js +++ b/browser/components/places/src/nsPlacesTransactionsService.js @@ -932,7 +932,19 @@ placesTagURITransaction.prototype = { function placesUntagURITransaction(aURI, aTags) { this._uri = aURI; - this._tags = aTags || PlacesUtils.tagging.getTagsForURI(this._uri, {}); + if (aTags) { + // Within this transaction, we cannot rely on tags given by itemId + // since the tag containers may be gone after we call untagURI. + // Thus, we convert each tag given by its itemId to name. + this._tags = aTags; + for (var i=0; i < aTags.length; i++) { + if (typeof(this._tags[i]) == "number") + this._tags[i] = PlacesUtils.bookmarks.getItemTitle(this._tags[i]); + } + } + else + this._tags = PlacesUtils.tagging.getTagsForURI(this._uri, {}); + this.redoTransaction = this.doTransaction; }