Closed shafiqhossain closed 8 years ago
Good point @shafiqhossain : the XMLRPC server returns a struct ("<member><name>field_tags</name><value><struct><member><name>en</name><value><array>
...") when the field is filled, an empty array ("<member><name>field_tags</name><value><array><data></data></array></value></member>
") when it's not and the JavaScriptSerializer
can't handle both.
Unfortunately I don't have a good solution for now, as possible workaround I would maybe define the field as an object
:
class Article : BaseNode
{
public object field_tags { get; set; }
}
thanks for the suggestion, what i did for now: node.Remove("field_fields_term_reference"); to remove the key which has empty fields. This way conversion giving no error. Not sure if this is the right way or not.
Struggling to update the text field and entity reference field, which is not working for me. Going to post another issue. Thanks
Some of the Drupal fields has empty value. It returns fields like this:
Empty fields: field_fields_term_reference, field_fields_text_field, field_fields_integer.. While converting to the node type it gives the following error:
Exception thrown: 'System.InvalidOperationException' in System.Web.Extensions.dll An unhandled exception of type 'System.InvalidOperationException' occurred in System.Web.Extensions.dll Additional information: Type 'Drupal7.Services.BaseClasses.fields_term_reference' is not supported for deserialization of an array.
How to handle this ?