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

Impossible to load location after a move request with the REST API

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 5.0, 5.1, 5.2, 5.3.5, 5.4.2, 2015.03
    • Fix Version/s: 5.4.3, 5.3.6, 2015.05
    • Component/s: Platform > REST API v2
    • Labels:
      None
    • Sprint:
      Pollux Platform S13

      Description

      After making a move request, the location given by the response header is not valid:

      curl -i 'http://ez.loc/api/ezp/v2/content/locations/1/43/60' -X MOVE \
        -H 'X-CSRF-Token: RE2XmfkKnryO5DX8EGXDZ6cKXnew9UX4u4DM-i2_SZY' \
        -H 'Cookie: eZSESSID=4mckpn65h67qtnu7inthuc2947' \
        -H 'Destination: /api/ezp/v2/content/locations/1/2'
      
      HTTP/1.1 201 Created
      Date: Mon, 18 May 2015 13:40:05 GMT
      Location: /api/ezp/v2/content/locations//1/2/60
      Content-Length: 0
      

      And when i try to access to /api/ezp/v2/content/locations//1/2/60 , I get an error:

      curl 'http://ez.loc/api/ezp/v2/content/locations//1/2/60' \
        -H 'Accept: application/vnd.ez.api.Location+json' \
        -H 'Cookie: eZSESSID=35rnfoorl8jho94ehkhoicob50' 
      
      {
          "ErrorMessage": {
              "_media-type": "application\/vnd.ez.api.ErrorMessage+json",
              "errorCode": 404,
              "errorMessage": "Not Found",
              "errorDescription": "Could not find location with path string \/1\/2\/60",
              "trace": "#0 [internal function]: eZ\\Publish\\Core\\REST\\Server\\Controller\\Location->loadLocation('\/1\/2\/60')\n#1 \/home\/stephane\/dev\/ezpublish-community\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/HttpKernel\/HttpKernel.php(145): call_user_func_array(Array, Array)\n#2 \/home\/stephane\/dev\/ezpublish-community\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/HttpKernel\/HttpKernel.php(66): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw(Object(Symfony\\Component\\HttpFoundation\\Request), 1)\n#3 \/home\/stephane\/dev\/ezpublish-community\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/HttpKernel\/DependencyInjection\/ContainerAwareHttpKernel.php(64): Symfony\\Component\\HttpKernel\\HttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#4 \/home\/stephane\/dev\/ezpublish-community\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/HttpKernel\/Kernel.php(185): Symfony\\Component\\HttpKernel\\DependencyInjection\\ContainerAwareHttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#5 \/home\/stephane\/dev\/ezpublish-community\/web\/index.php(81): Symfony\\Component\\HttpKernel\\Kernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request))\n#6 {main}",
              "file": "\/home\/stephane\/dev\/ezpublish-community\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Publish\/Core\/REST\/Server\/Controller\/Location.php",
              "line": 143
          }
      

      Obviously if I use a location with only one "/" ( 'http://ez.loc/api/ezp/v2/content/locations/1/2/60' ), this will work perfectly.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              stephane.diot@ez.no St├ęphane Diot
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 4 hours
                4h
                Remaining:
                Time Spent - 30 minutes Remaining Estimate - 1 hour
                1h
                Logged:
                Time Spent - 30 minutes Remaining Estimate - 1 hour Time Not Required
                30m