From 0f0f161d8a6957f7178c0c886ab08e471b379afd Mon Sep 17 00:00:00 2001 From: John Porter Date: Sat, 11 May 2013 18:03:57 +0100 Subject: [PATCH 1/3] Remove noConflict as duplicators fail --- assets/xmlimporter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/xmlimporter.js b/assets/xmlimporter.js index 3530cc1..e94f4b6 100644 --- a/assets/xmlimporter.js +++ b/assets/xmlimporter.js @@ -18,4 +18,4 @@ }).trigger('change.xmlimporter'); }); -})(jQuery.noConflict()); +})(jQuery); From c3262e7962a2e5b6d83e9d35f1db84dfe9af3dab Mon Sep 17 00:00:00 2001 From: John Porter Date: Sat, 11 May 2013 20:39:07 +0100 Subject: [PATCH 2/3] Fix if root node is being used --- content/content.importers.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/content/content.importers.php b/content/content.importers.php index 1807fc7..23e3a2b 100644 --- a/content/content.importers.php +++ b/content/content.importers.php @@ -173,7 +173,12 @@ public function __viewRun() { $xml->preserveWhiteSpace = false; $xml->formatOutput = true; - $xml->loadXML($entry->ownerDocument->saveXML($entry)); + if(is_null($entry->ownerDocument)) { + $xml->loadXML($entry->saveXML()); + } + else { + $xml->loadXML($entry->ownerDocument->saveXML($entry)); + } $source = htmlentities($xml->saveXML($xml->documentElement), ENT_COMPAT, 'UTF-8'); From 672f604fdd77334c2c97fd486149d26911bf7920 Mon Sep 17 00:00:00 2001 From: John Porter Date: Sat, 11 May 2013 20:39:42 +0100 Subject: [PATCH 3/3] arrays, even empty ones, need to be a string --- lib/class.xmlimporter.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/class.xmlimporter.php b/lib/class.xmlimporter.php index 0cf8880..388be0d 100644 --- a/lib/class.xmlimporter.php +++ b/lib/class.xmlimporter.php @@ -220,8 +220,13 @@ function handleXMLError($errno, $errstr, $errfile, $errline, $context) { foreach ($current['values'] as $field_id => $value) { $field = FieldManager::fetch($field_id); - if(is_array($value) && count($value) === 1) { - $value = current($value); + if(is_array($value)) { + if(count($value) === 1) { + $value = current($value); + } + if(count($value) === 0) { + $value = ''; + } } // Adjust value?