From bafd03fc37534a0487ee140eb605446f2a57fa1b Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Thu, 15 Jan 2015 15:07:20 +0000 Subject: [PATCH] Fixed user metadata transforms not occurring. This caused eg. all Bash Tags to be saved as "Add", even if they were inputted as "Remove". --- resources/report/html/loot-plugin-editor.html | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/resources/report/html/loot-plugin-editor.html b/resources/report/html/loot-plugin-editor.html index b089f9ca..c324f85c 100644 --- a/resources/report/html/loot-plugin-editor.html +++ b/resources/report/html/loot-plugin-editor.html @@ -324,33 +324,33 @@ loot-editor-close } else if (tables[j].parentElement.id == 'inc') { plugin.userlist.inc = rowsData; } else if (tables[j].parentElement.id == 'message') { - rowsData.forEach(function(data){ - data.content = [{ - str: data.content, - lang: data.language + rowsData.forEach(function(value, index, arr){ + arr[index].content = [{ + str: value.content, + lang: value.language }] - delete data.language; + delete arr[index].language; }); plugin.userlist.msg = rowsData; } else if (tables[j].parentElement.id == 'tags') { - rowsData.forEach(function(data){ - data = oldData.convTagObj(data); + rowsData.forEach(function(value, index, arr){ + arr[index] = oldData.convTagObj(value); }); plugin.userlist.tag = rowsData; } else if (tables[j].parentElement.id == 'dirty') { - rowsData.forEach(function(data){ - data.crc = parseInt(data.crc, 16); + rowsData.forEach(function(value, index, arr){ + arr[index].crc = parseInt(value.crc, 16); }); plugin.userlist.dirty = rowsData; } else if (tables[j].parentElement.id == 'locations') { - rowsData.forEach(function(data){ + rowsData.forEach(function(value, index, arr){ /* User metadata can only specify one version, but it should be a list. */ - if (data.ver.length > 0) { - data.ver = [ - data.ver + if (value.ver.length > 0) { + arr[index].ver = [ + value.ver ]; } else { - delete data.ver; + delete arr[index].ver; } }); plugin.userlist.url = rowsData;