Ensure arrays exist in ZU.itemToExportFormat()

This commit is contained in:
Simon Kornblith 2012-11-25 16:03:55 -05:00
parent 3403bedc8e
commit 5f66482537

View file

@ -1169,6 +1169,12 @@ Zotero.Utilities = {
* uniqueFields array
*/
"itemToExportFormat":function(item) {
const CREATE_ARRAYS = ['creators', 'notes', 'tags', 'seeAlso', 'attachments'];
for(var i=0; i<CREATE_ARRAYS.length; i++) {
var createArray = CREATE_ARRAYS[i];
if(!item[createArray]) item[createArray] = [];
}
item.uniqueFields = {};
// get base fields, not just the type-specific ones