- Fix an XML parsing error (due to trailing whitespace, weirdly) that could cause endless sync icon spinning

- Remove extra whitespace in collection-item blocks that was causing sync upload errors (also fixed on the server)
This commit is contained in:
Dan Stillman 2010-08-26 21:34:44 +00:00
parent 4bc7ab9016
commit 6a629490b3

View file

@ -1351,8 +1351,10 @@ Zotero.Sync.Server = new function () {
_error(response.firstChild.firstChild.nodeValue);
}
var xml = Zotero.Utilities.prototype.trim(xmlhttp.responseText.replace(/<\?xml.*\?>\s*/, ''));
// Strip XML declaration and convert to E4X
var xml = new XML(xmlhttp.responseText.replace(/<\?xml.*\?>/, ''));
xml = new XML(xml);
try {
var updateKey = xml.@updateKey.toString();
@ -3741,7 +3743,7 @@ Zotero.Sync.Server.Data = new function() {
xml.collections + ' ' + child.id : child.id;
}
else */if (child.type == 'item') {
xml.items = xml.items ?
xml.items = xml.items.toString() ?
xml.items + ' ' + child.key : child.key;
}
}