From 52e62e76653bacc9b6a0f1343e3e364b4167cf2b Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 26 Feb 2013 16:35:02 +0000 Subject: [PATCH] fix importing alternativeTitles --- static/js/pandora/metadataDialog.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/static/js/pandora/metadataDialog.js b/static/js/pandora/metadataDialog.js index 372f7fa87..a17253163 100644 --- a/static/js/pandora/metadataDialog.js +++ b/static/js/pandora/metadataDialog.js @@ -172,7 +172,7 @@ pandora.ui.metadataDialog = function(data) { if (result.data) { imdb = result.data; if (imdb.originalTitle) { - imdb.alternativeTitles = [imdb.title, []].concat(imdb.alternativeTitles || []); + imdb.alternativeTitles = [[imdb.title, []]].concat(imdb.alternativeTitles || []); imdb.title = imdb.originalTitle; } keys.forEach(function(key, index) { @@ -289,7 +289,8 @@ pandora.ui.metadataDialog = function(data) { function updateMetadata() { var edit = {id: data.id}, type; updateKeys.forEach(function(key) { - type = Ox.getObjectById(pandora.site.itemKeys, key).type; + type = key == 'alternativeTitles' ? [] + : Ox.getObjectById(pandora.site.itemKeys, key).type; edit[key] = imdb[key] || ( Ox.isArray(type) ? [] : '' );