Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-30237

PATCH /content/objects/<ID>/versions/<versionNo> returns 'xml' index is missing in hash

    Details

      Description

      After executing PATCH /content/objects/<ID>/versions/<versionNo> I get an error:

      <ErrorMessage media-type="application/vnd.ez.api.ErrorMessage+xml">
          <errorCode>500</errorCode>
          <errorMessage>Internal Server Error</errorMessage>
          <errorDescription>'xml' index is missing in hash.</errorDescription>
      

        Activity

        Hide
        Dawid Parafiński added a comment - - edited

        As stated in docs, xml content (and that is richText in into fieldtype) should be escaped with xml fieldValue key.
        https://doc.ezplatform.com/en/latest/api/field_type_reference/#rest-api-specifics_1

        So your payload should looks like this

        <?xml version="1.0" encoding="UTF-8"?>
        <VersionUpdate xmlns:p="http://ez.no/API/Values"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://ez.no/API/Values ../VersionUpdate.xsd ">
          <modificationDate>2018-11-09T14:50:16</modificationDate>
          <initialLanguageCode>eng-GB</initialLanguageCode>
          <fields>
            <field>
              <id>7777</id>
              <fieldDefinitionIdentifier>title</fieldDefinitionIdentifier>
              <languageCode>eng-GB</languageCode>
              <fieldValue>New article 7</fieldValue>
            </field>
            <field>
              <id>1235</id>
              <fieldDefinitionIdentifier>intro</fieldDefinitionIdentifier>
              <languageCode>eng-GB</languageCode>
              <fieldValue>
              <value key="xml">
        &lt;?xml version="1.0" encoding="UTF-8"?&gt;
        &lt;section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ezxhtml="http://ez.no/xmlns/ezpublish/docbook/xhtml" xmlns:ezcustom="http://ez.no/xmlns/ezpublish/docbook/custom" version="5.0-variant ezpublish-1.0"&gt;
        &lt;title ezxhtml:level="2"&gt;777777777777788880000&lt;/title&gt;
        &lt;/section&gt;
              </value>
              </fieldValue>
            </field>
          </fields>
        </VersionUpdate>
        

        Show
        Dawid Parafiński added a comment - - edited As stated in docs, xml content (and that is richText in into fieldtype) should be escaped with xml fieldValue key. https://doc.ezplatform.com/en/latest/api/field_type_reference/#rest-api-specifics_1 So your payload should looks like this <?xml version="1.0" encoding="UTF-8"?> <VersionUpdate xmlns:p="http://ez.no/API/Values" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://ez.no/API/Values ../VersionUpdate.xsd "> <modificationDate>2018-11-09T14:50:16</modificationDate> <initialLanguageCode>eng-GB</initialLanguageCode> <fields> <field> <id>7777</id> <fieldDefinitionIdentifier>title</fieldDefinitionIdentifier> <languageCode>eng-GB</languageCode> <fieldValue>New article 7</fieldValue> </field> <field> <id>1235</id> <fieldDefinitionIdentifier>intro</fieldDefinitionIdentifier> <languageCode>eng-GB</languageCode> <fieldValue> <value key="xml"> &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ezxhtml="http://ez.no/xmlns/ezpublish/docbook/xhtml" xmlns:ezcustom="http://ez.no/xmlns/ezpublish/docbook/custom" version="5.0-variant ezpublish-1.0"&gt; &lt;title ezxhtml:level="2"&gt;777777777777788880000&lt;/title&gt; &lt;/section&gt; </value> </fieldValue> </field> </fields> </VersionUpdate>

          People

          • Assignee:
            Unassigned
            Reporter:
            Magdalena Zuba
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: