Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Christopher Galvan 4 posts 24 karma points
    Sep 18, 2013 @ 00:07
    Christopher Galvan
    0

    Courier and Multi-node tree picker with CSV

    Courier and Multi-node tree picker with CSV

    I'm having some trouble with Courier and the multi-node tree picker (csv storage) datatype. An error is occurring when I'm trying to install/import a revision into an Umbraco instance. When I'm try to import any object that has a datatype field of multi-node tree picker (csv storage) the following error is logged:

    System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.
       at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
       at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
       at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
       at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
       at System.Xml.XmlDocument.Load(XmlReader reader)
       at System.Xml.XmlDocument.LoadXml(String xml)
       at Umbraco.Courier.Core.Helpers.XmlDependencies.ReplaceIds(String xml, String xPath, String attribute, IdentifierReplaceDirection direction, List`1& replacedIds)xml: f765c996-d7b4-40bd-9266-4620afb4c607,af77eeaf-5da5-4a8f-9a61-15db3566b28f,383b6372-94e8-420c-99d3-8eca76aa6fae
      
    It seems like the data resolver for multi-node node tree picker fields isn't handling csv storage, as the error is about invalid xml. As a result, the multi-node tree picker fields are being imported as empty. Here is an excerpt from the data that Courier is packaging for a multi-node tree picker property:

    <ContentProperty>
        <Alias>products</Alias>
        <DataType>c0a225e2-918e-47b0-b69e-b4ea526775a0</DataType>
        <DataTypeEditor>7e062c13-7c41-4ad9-b389-41d88aeef87c</DataTypeEditor>
        <DBType>Ntext</DBType>
        <PreValueEditor>umbraco.editorControls.MultiNodeTreePicker.MNTP_PrevalueEditor</PreValueEditor>
        <Value xsi:type="xsd:string">f765c996-d7b4-40bd-9266-4620afb4c607,8b35cd01-738a-4898-acf1-298587d5e5e0,af77eeaf-5da5-4a8f-9a61-15db3566b28f,383b6372-94e8-420c-99d3-8eca76aa6fae</Value>
    </ContentProperty>

    You can see that the value element contains a comma-delimited string of Guids. From what is configured in the "courier.config" file for itemDataResolvers > ContentPickers :

    <contentPickers>
        <!-- add new datatype elements for data types that stores page ids (ex: "1242" or "1726,2362,2323") -->
        <add key="contentPicker">158aa029-24ed-4948-939e-c3da209e5fba</add>
        <add key="ultimatePicker">cdbf0b5d-5cb2-445f-bc12-fcaaec07cf2c</add>

        <add key="Ucomponents-XpathCheckboxlist">d2d46927-f4f8-4b1b-add7-661cc09a0539</add>
        <add key="Ucomponents-XpathDropdownlist">57a62843-c488-4c29-8125-52f51873613e</add>

        <add key="XpathCheckboxlist">34451d92-d270-49ba-8c7f-ee55bfeee1cb</add>
        <add key="XpathDropdownlist">173a96ae-00ed-4a7c-9f76-4b53d4a0a1b9</add>

        <add key="Ucomponents-AutoComplete">31aa0d5c-f8e1-4cdc-a66e-c7f8c09498ef</add>
        <add key="Ucomponents-MNTP-CSV">c2d6894b-e788-4425-bcf2-308568e3d38b</add>
        <add key="MNTP-CSV">7e062c13-7c41-4ad9-b389-41d88aeef87c</add>
    </contentPickers>

    The MNTP-CSV data resolver is configured for this datatype, which should be using the Umbraco.Courier.uComponents.MultinodePicker from the Courier Contrib source code. After looking at the MultinodePicker data resolver source, it looks like it can't handle csv storage at all; only xml storage is supported. Is there a data resolver for this that supports csv storage or do I have to write my own? Any thoughts?


    Thanks,
    Chris

Please Sign in or register to post replies

Write your reply to:

Draft