From 02e9361ea056d3f4789eb0360a82503b5ecc86f7 Mon Sep 17 00:00:00 2001 From: Ernesto Buenrostro Date: Fri, 7 May 2021 10:10:43 -0700 Subject: [PATCH] see #732 Encoding the extra fields so it can be stored in the XML --- .../mugoobjectrelationlist/mugoobjectrelationlisttype.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/datatypes/mugoobjectrelationlist/mugoobjectrelationlisttype.php b/datatypes/mugoobjectrelationlist/mugoobjectrelationlisttype.php index f1a0001..1e2a5a8 100755 --- a/datatypes/mugoobjectrelationlist/mugoobjectrelationlisttype.php +++ b/datatypes/mugoobjectrelationlist/mugoobjectrelationlisttype.php @@ -2194,7 +2194,7 @@ function serializeContentClassAttribute( $classAttribute, $attributeNode, $attri if ( isset( $content['extra_fields'] ) ) { $extra_fields = $dom->createElement( 'extra_fields' ); - $extra_fields->appendChild( $dom->createTextNode( $content['extra_fields'] ) ); + $extra_fields->appendChild( $dom->createTextNode( json_encode($content['extra_fields']) ) ); $attributeParametersNode->appendChild( $extra_fields ); } @@ -2233,7 +2233,7 @@ function unserializeContentClassAttribute( $classAttribute, $attributeNode, $att $content['object_class'] = $objectClassNode->textContent; } - $extra_fields = $attributeParametersNode->getElementsByTagName( 'extra_fields' ); + $extra_fields = json_decode( $attributeParametersNode->getElementsByTagName( 'extra_fields' ), true ); foreach( $extra_fields as $option ) { $content['extra_fields']['name'] = $option->getAttribute( 'value' );