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

PHP Fatal error: Method eZ\Publish\Core\FieldType\XmlText\Value::__toString() must return a string value

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: High High
    • 5.1
    • None
    • None
    • None
    • This is encountered while retrieving a ContentType using the REST API after creating it (using REST API as well) while it contains an XmlText field

    Description

      The Json used to create the Content Type:

      {
          "ContentTypeCreate": {
              "identifier": "TContentType",
              "mainLanguageCode": "eng-GB",
              "urlAliasSchema": "<name>",
              "nameSchema": "<name>",
              "isContainer": "true",
              "defaultSortField": "PATH",
              "defaultSortOrder": "ASC",
              "defaultAlwaysAvailable": "true",
              "names": {
              "value": [
                  {
                  "_languageCode": "eng-GB",
                  "#text": "RESTv2DatatypeTest"
                  }
              ]
              },
              "descriptions": {
              "value": [
                  {
                  "_languageCode": "eng-GB",
                  "#text": "This is a description"
                  }
              ]
              },
              "FieldDefinitions": {
              "FieldDefinition": [
                  {
                  "identifier": "name",
                  "fieldType": "ezstring",
                  "names": {
                      "value": [
                      {
                          "_languageCode": "eng-GB",
                          "#text": "Name"
                      }
                      ]
                  },
                  "descriptions": {
                      "value": [
                      {
                          "_languageCode": "eng-GB",
                          "#text": "This is the name"
                      }
                      ]
                  },
                  "fieldGroup": "content",
                  "position": "1",
                  "isTranslatable": "true",
                  "isRequired": "true",
                  "isInfoCollector": "false",
                  "isSearchable": "true",
                  "defaultValue": "New Name"
                  }
                  ,
              {
                "identifier": "xmltext",
                "fieldType": "ezxmltext",
                "names": {
                  "value": [
                    {
                      "_languageCode": "eng-GB",
                      "#text": "XmlText"
                    }
                  ]
                },
                "descriptions": {
                  "value": [
                    {
                      "_languageCode": "eng-GB",
                      "#text": "This is a ezxmltext test"
                    }
                  ]
                },
                "fieldGroup": "content",
                "position": "2",
                "isTranslatable": "true",
                "isRequired": "false",
                "isInfoCollector": "false",
                "isSearchable": "true"
                ,"fieldSettings": {
                              "numRows": 10
                          }
              }
              ]
              }
          }
        }
      

      The call that triggers the error:

      http --auth $user:$password GET 'http://$hostname/api/ezp/v2/content/types/40'
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            patrick.allaert-obsolete@ez.no Patrick Allaert (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 10 minutes
                2h 10m