commit e1349ec308580ec65eb5f24589fccdafe61b4a82
parent f74760b8ad1dfe59973e94826684f88b6189b3ca
Author: Dan Stillman <dstillman@zotero.org>
Date: Tue, 9 Mar 2010 06:07:45 +0000
Reindex search condition ids on search load in case they're not contiguous (fixes sync error)
Diffstat:
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/chrome/content/zotero/xpcom/search.js b/chrome/content/zotero/xpcom/search.js
@@ -208,6 +208,9 @@ Zotero.Search.prototype.load = function() {
+ "WHERE savedSearchID=? ORDER BY searchConditionID";
var conditions = Zotero.DB.query(sql, this._id);
+ // Reindex conditions, in case they're not contiguous in the DB
+ var conditionID = 1;
+
for (var i in conditions) {
// Parse "condition[/mode]"
var [condition, mode] =
@@ -227,14 +230,16 @@ Zotero.Search.prototype.load = function() {
conditions[i].value = Zotero.ItemTypes.getName(conditions[i].value);
}
- this._conditions[conditions[i]['searchConditionID']] = {
- id: conditions[i]['searchConditionID'],
+ this._conditions[conditionID] = {
+ id: conditionID,
condition: condition,
mode: mode,
operator: conditions[i]['operator'],
value: conditions[i]['value'],
required: conditions[i]['required']
};
+
+ conditionID++;
}
}