Fix skipClientDateModifiedUpdate DataObject save option

This commit is contained in:
Dan Stillman 2017-06-16 01:56:43 -04:00
parent 8de0b024f0
commit 2f93065986
4 changed files with 56 additions and 50 deletions

View File

@ -286,6 +286,7 @@ Zotero.Collection.prototype._saveData = Zotero.Promise.coroutine(function* (env)
env.parent ? env.parent : null
);
if (env.sqlColumns.length) {
if (isNew) {
env.sqlColumns.unshift('collectionID');
env.sqlValues.unshift(collectionID ? { int: collectionID } : null);
@ -301,6 +302,7 @@ Zotero.Collection.prototype._saveData = Zotero.Promise.coroutine(function* (env)
env.sqlValues.push(collectionID ? { int: collectionID } : null);
yield Zotero.DB.queryAsync(sql, env.sqlValues);
}
}
if (this._changed.parentKey) {
// Add this item to the parent's cached item lists after commit,

View File

@ -959,7 +959,7 @@ Zotero.DataObject.prototype._saveData = function (env) {
env.sqlValues.push(0);
}
if (env.isNew || !env.options.skipClientDateModified) {
if (env.isNew || !env.options.skipClientDateModifiedUpdate) {
env.sqlColumns.push('clientDateModified');
env.sqlValues.push(Zotero.DB.transactionDateTime);
}

View File

@ -1268,6 +1268,7 @@ Zotero.Item.prototype._saveData = Zotero.Promise.coroutine(function* (env) {
env.sqlValues.push(this.dateModified);
}
if (env.sqlColumns.length) {
if (isNew) {
env.sqlColumns.push('dateAdded');
env.sqlValues.push(this.dateAdded ? this.dateAdded : Zotero.DB.transactionDateTime);
@ -1292,6 +1293,7 @@ Zotero.Item.prototype._saveData = Zotero.Promise.coroutine(function* (env) {
Zotero.Notifier.queue('modify', 'item', itemID, env.notifierData, env.options.notifierQueue);
}
}
}
//
// ItemData

View File

@ -171,6 +171,7 @@ Zotero.Search.prototype._saveData = Zotero.Promise.coroutine(function* (env) {
{ string: this.name }
);
if (env.sqlColumns.length) {
if (isNew) {
env.sqlColumns.unshift('savedSearchID');
env.sqlValues.unshift(searchID ? { int: searchID } : null);
@ -186,6 +187,7 @@ Zotero.Search.prototype._saveData = Zotero.Promise.coroutine(function* (env) {
env.sqlValues.push(searchID ? { int: searchID } : null);
yield Zotero.DB.queryAsync(sql, env.sqlValues);
}
}
if (this._changed.conditions) {
if (!isNew) {