From 23c41970b57bf21f0ac229cd5a6f8b47900e67eb Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 16 May 2013 18:45:45 -0400 Subject: [PATCH] CRM-12647 - Simplify. Separate field-rewriting from XML encoding ---------------------------------------- * CRM-12647: Customization export/import crashes on "&" http://issues.civicrm.org/jira/browse/CRM-12647 --- CRM/Utils/Migrate/Export.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/CRM/Utils/Migrate/Export.php b/CRM/Utils/Migrate/Export.php index 4cb3fadb85..e616c23bfb 100644 --- a/CRM/Utils/Migrate/Export.php +++ b/CRM/Utils/Migrate/Export.php @@ -373,8 +373,9 @@ AND entity_id IS NULL exit(); } } + + $value = $object->$name; if ($name == 'field_name') { - $value = $object->$name; // hack for profile field_name if (substr($value, 0, 7) == 'custom_') { $cfID = substr($value, 7); @@ -382,9 +383,6 @@ AND entity_id IS NULL $value = "custom.{$tableName}.{$columnName}"; } } - else { - $value = str_replace(CRM_Core_DAO::VALUE_SEPARATOR, self::XML_VALUE_SEPARATOR, $object->$name); - } $keyValues[$name] = $value; } } @@ -392,7 +390,7 @@ AND entity_id IS NULL // We're ready to format $keyValues as XML $xml = " <$objectName>"; foreach ($keyValues as $k => $v) { - $xml .= "\n " . $this->renderTextTag($k, $v); + $xml .= "\n " . $this->renderTextTag($k, str_replace(CRM_Core_DAO::VALUE_SEPARATOR, self::XML_VALUE_SEPARATOR, $v)); } if ($additional) { $xml .= $additional; -- 2.25.1