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

Error 406 on publishing richtext content with embedded image

    XMLWordPrintable

Details

    Description

      Steps to reproduce:

      1. Go to PlatformUI;

      2. Create and publish an image of content type "image" with an uploaded image from your local drive;

      3. Create an article on "eZ Platform" content (former "Home"), and on its richtext field, insert the image content you created previously;

      4. Open firebug or similar dev tools and go to Network tab or wherever you can analyse HTTP Requests and Responses;

      5. Publish the content.
      Verify that you get an error on your dev tools:

      406 Not acceptable POST for "objects"
      

      Headers:
      Response headers

      Cache-Control:"private"
      Connection:"Keep-Alive"
      Content-Length:"486"
      Content-Type:"application/vnd.ez.api.ErrorMessage+json"
      Date:"Thu, 03 Dec 2015 14:45:51 GMT"
      Keep-Alive:"timeout=5, max=100"
      Server:"Apache/2.2.22 (Debian)"
      Vary:"Cookie,Authorization"
      X-Powered-By:"PHP/5.4.45-0+deb7u2"
      

      Request headers

      Host:"ezp5.rui"
      User-Agent:"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:41.0) Gecko/20100101 Firefox/41.0"
      Accept:"application/vnd.ez.api.Content+json"
      Accept-Language:"en-US,en;q=0.5"
      Accept-Encoding:"gzip, deflate"
      Content-Type:"application/vnd.ez.api.ContentCreate+json; charset=UTF-8"
      X-CSRF-Token:"GeTkeGeqR6X7ATAxDD1LrTMWsIb3zg21d-yMKaBneXM"
      Referer:"http://ezp5.rui/ez"
      Content-Length:"1760"
      Cookie:"eZSESSID98defd6ee70dfb1dea416cecdf391f58=vuj9898uemdi4rvhndq3ut0k11"
      Connection:"keep-alive"
      Pragma:"no-cache"
      Cache-Control:"no-cache"
      

      Params:

      {"ContentCreate":{"ContentType":{"_href":"/api/ezp/v2/content/types/2"},"mainLanguageCode":"eng-GB","LocationCreate":{"ParentLocation":{"_href":"/api/ezp/v2/content/locations/1/2"},"sortField":"PATH","sortOrder":"ASC"},"Section":null,"alwaysAvailable":false,"remoteId":null,"modificationDate":"2015-12-03T14:45:47.085Z","fields":{"field":[{"fieldDefinitionIdentifier":"title","fieldValue":"Awesome Article"},{"fieldDefinitionIdentifier":"short_title","fieldValue":""},{"fieldDefinitionIdentifier":"author","fieldValue":[{"id":0,"name":"Administrator User","email":"nospam@ez.no"}]},{"fieldDefinitionIdentifier":"intro","fieldValue":{"xml":"<section xmlns=\"http://ez.no/namespaces/ezpublish5/xhtml5/edit\"><div class=\"ez-embed-type-image\" data-ezelement=\"ezembed\" data-href=\"ezcontent://53\" data-ezview=\"embed\"><span data-ezelement=\"ezconfig\"><span data-ezvalue-key=\"size\" data-ezelement=\"ezvalue\">medium</span></span><img src=\"http://ezp5.rui/var/storage/images/_aliases/medium/6/8/1/0/186-1-eng-GB/super_awesome_ninja_penguins_by_ultimatedragon.jpg\"></div><h1>Red pandas rule as well!</h1><div class=\"ez-embed-type-image\" data-ezelement=\"ezembed\" data-href=\"ezcontent://52\" data-ezview=\"embed\"><span data-ezelement=\"ezconfig\"><span data-ezvalue-key=\"size\" data-ezelement=\"ezvalue\">medium</span></span><img src=\"http://ezp5.rui/var/storage/images/_aliases/medium/3/8/1/0/183-1-eng-GB/Cute-Red-Panda-1.jpg\"></div><p>&nbsp;</p></section>"}},{"fieldDefinitionIdentifier":"body","fieldValue":{"xml":"<section xmlns=\"http://ez.no/namespaces/ezpublish5/xhtml5/edit\"></section>"}},{"fieldDefinitionIdentifier":"enable_comments","fieldValue":false},{"fieldDefinitionIdentifier":"image","fieldValue":{"destinationContentId":null}}]}}}
      

      Response

      ErrorMessage:Object
          _media-type:"application/vnd.ez.api.ErrorMessage+json"
          errorCode:406
          errorMessage:"Not Acceptable"
          errorDescription:"Argument '$inputValue' is invalid: Could not create XML document: Opening and ending tag mismatch: img line 1 and div
      Opening and ending tag mismatch: img line 1 and div
      Entity 'nbsp' not defined
      Opening and ending tag mismatch: div line 1 and section
      Premature end of data in tag div line 1
      Premature end of data in tag section line 1"
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            rui.silva-obsolete@ez.no Rui Silva (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: