Trigger full reset on missing collection parent
This commit is contained in:
parent
0ac95bfacd
commit
28bbce4bf5
1 changed files with 7 additions and 0 deletions
|
@ -3221,6 +3221,7 @@ Zotero.Sync.Server.Data = new function() {
|
|||
* Recursively save collections from the top down
|
||||
*/
|
||||
function _saveCollections(collections) {
|
||||
var originalLength = collections.length;
|
||||
var unsaved = [];
|
||||
|
||||
var parentKey, parentCollection;
|
||||
|
@ -3246,6 +3247,12 @@ Zotero.Sync.Server.Data = new function() {
|
|||
continue;
|
||||
}
|
||||
|
||||
if (unsaved.length == originalLength) {
|
||||
var msg = "Incomplete collection hierarchy cannot be saved in Zotero.Sync.Server.Data._saveCollections()";
|
||||
var e = new Zotero.Error(msg, "MISSING_OBJECT");
|
||||
throw (e);
|
||||
}
|
||||
|
||||
if (unsaved.length) {
|
||||
_saveCollections(unsaved);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue