From c48017e174e8e5c282708ec38c0f3bf6507fa62a Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 15 May 2017 09:37:29 +0200 Subject: [PATCH] Convert all metadata fields to string The XML builder expects string, strictly. Only None is handled separately. Contributes to issue CURA-3808. --- plugins/XmlMaterialProfile/XmlMaterialProfile.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/XmlMaterialProfile/XmlMaterialProfile.py b/plugins/XmlMaterialProfile/XmlMaterialProfile.py index 197a7b778f..7bdfaf404d 100644 --- a/plugins/XmlMaterialProfile/XmlMaterialProfile.py +++ b/plugins/XmlMaterialProfile/XmlMaterialProfile.py @@ -159,10 +159,10 @@ class XmlMaterialProfile(InstanceContainer): for key, value in metadata.items(): builder.start(key) - # Normally value is a string. - # Nones get handled well. - if isinstance(value, bool): - value = str(value) # parseBool in deserialize expects 'True'. + if value is not None: #Nones get handled well by the builder. + #Otherwise the builder always expects a string. + #Deserialize expects the stringified version. + value = str(value) builder.data(value) builder.end(key)