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

Impossible to change the main location of content

    Details

      Description

      When calling REST API for changing the main location of content it throws a 404 error and message that location with given id doesn't exists, however the location exists.

      Dump from web browser's cURL call:

      curl 'http://ez.loc/api/ezp/v2/content/objects/162' \
      -X PATCH \
      -H 'Pragma: no-cache' \
      -H 'Origin: http://ez.loc' \
      -H 'Accept-Encoding: gzip, deflate, sdch' \
      -H 'X-CSRF-Token: XWDpUpnncDjpQx6UE1R0saE9LPbzSQwy6PdxaExfpJo' \
      -H 'Accept-Language: pl-PL,pl;q=0.8,en-US;q=0.6,en;q=0.4' \
      -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36' \
      -H 'Content-Type: application/vnd.ez.api.ContentUpdate+json' \
      -H 'Accept: application/vnd.ez.api.ContentInfo+json' \
      -H 'Cache-Control: no-cache' \
      -H 'Referer: http://ez.loc/ez' \
      -H 'Cookie: eZSESSID=m07t5adupca9kt2djg0etd8ns0' \
      -H 'Connection: keep-alive' \
      --data-binary '{"ContentUpdate":{"MainLocation":{"_href":"/api/ezp/v2/content/locations/1/2/61/179"}}}' \
      --compressed
      

      And response dump:

      {
          "ErrorMessage": {
              "_media-type": "application\/vnd.ez.api.ErrorMessage+json",
              "errorCode": 404,
              "errorMessage": "Not Found",
              "errorDescription": "Could not find 'location' with identifier '\/1\/2\/61\/179'",
              "trace": "#0 \/home\/mhyndle\/Kaliop\/ez\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Publish\/Core\/Persistence\/Legacy\/Content\/Location\/Gateway\/ExceptionConversion.php(59): eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\Location\\Gateway\\DoctrineDatabase->getBasicNodeData('\/1\/2\/61\/179')\n#1 \/home\/mhyndle\/Kaliop\/ez\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Publish\/Core\/Persistence\/Legacy\/Content\/TreeHandler.php(156): eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\Location\\Gateway\\ExceptionConversion->getBasicNodeData('\/1\/2\/61\/179')\n#2 \/home\/mhyndle\/Kaliop\/ez\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Publish\/Core\/Persistence\/Legacy\/Content\/TreeHandler.php(230): eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\TreeHandler->loadLocation('\/1\/2\/61\/179')\n#3 \/home\/mhyndle\/Kaliop\/ez\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Publish\/Core\/Persistence\/Legacy\/Content\/Location\/Handler.php(484): eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\TreeHandler->changeMainLocation(162, '\/1\/2\/61\/179')\n#4 \/home\/mhyndle\/Kaliop\/ez\/ezpublish\/cache\/dev\/ezpublishDevDebugProjectContainer.php(38107): eZ\\Publish\\Core\\Persistence\\Legacy\\Content\\Location\\Handler->changeMainLocation(162, '\/1\/2\/61\/179')\n#5 \/home\/mhyndle\/Kaliop\/ez\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Publish\/Core\/Persistence\/Cache\/LocationHandler.php(261): eZPublishCorePersistenceLegacyContentLocationHandler_000000001bae38bf00007f488b13eb4324e4210fa3b07aebefa997a3fb17019d->changeMainLocation(162, '\/1\/2\/61\/179')\n#6 \/home\/mhyndle\/Kaliop\/ez\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Publish\/Core\/Repository\/ContentService.php(916): eZ\\Publish\\Core\\Persistence\\Cache\\LocationHandler->changeMainLocation(162, '\/1\/2\/61\/179')\n#7 \/home\/mhyndle\/Kaliop\/ez\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Publish\/Core\/SignalSlot\/ContentService.php(269): eZ\\Publish\\Core\\Repository\\ContentService->updateContentMetadata(Object(eZ\\Publish\\API\\Repository\\Values\\Content\\ContentInfo), Object(eZ\\Publish\\Core\\REST\\Common\\Values\\RestContentMetadataUpdateStruct))\n#8 \/home\/mhyndle\/Kaliop\/ez\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Publish\/Core\/REST\/Server\/Controller\/Content.php(141): eZ\\Publish\\Core\\SignalSlot\\ContentService->updateContentMetadata(Object(eZ\\Publish\\API\\Repository\\Values\\Content\\ContentInfo), Object(eZ\\Publish\\Core\\REST\\Common\\Values\\RestContentMetadataUpdateStruct))\n#9 [internal function]: eZ\\Publish\\Core\\REST\\Server\\Controller\\Content->updateContentMetadata('162', Object(Symfony\\Component\\HttpFoundation\\Request))\n#10 \/home\/mhyndle\/Kaliop\/ez\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/HttpKernel\/HttpKernel.php(147): call_user_func_array(Array, Array)\n#11 \/home\/mhyndle\/Kaliop\/ez\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/HttpKernel\/HttpKernel.php(68): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw(Object(Symfony\\Component\\HttpFoundation\\Request), 1)\n#12 \/home\/mhyndle\/Kaliop\/ez\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/HttpKernel\/DependencyInjection\/ContainerAwareHttpKernel.php(69): Symfony\\Component\\HttpKernel\\HttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#13 \/home\/mhyndle\/Kaliop\/ez\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/HttpKernel\/Kernel.php(196): Symfony\\Component\\HttpKernel\\DependencyInjection\\ContainerAwareHttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#14 \/home\/mhyndle\/Kaliop\/ez\/web\/index.php(66): Symfony\\Component\\HttpKernel\\Kernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request))\n#15 {main}",
              "file": "\/home\/mhyndle\/Kaliop\/ez\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Publish\/Core\/Persistence\/Legacy\/Content\/Location\/Gateway\/DoctrineDatabase.php",
              "line": 86
          }
      }
      

        Issue Links

          Activity

          Hide
          Damien Pobel (Inactive) added a comment - - edited

          Bertrand Dunogier any opinion on that ?

          Show
          Damien Pobel (Inactive) added a comment - - edited Bertrand Dunogier any opinion on that ?
          Hide
          Bertrand Dunogier added a comment -

          Sounds like a valid bug to me.

          Show
          Bertrand Dunogier added a comment - Sounds like a valid bug to me.
          Show
          Bertrand Dunogier added a comment - Bugfix PR https://github.com/ezsystems/ezpublish-kernel/pull/1508 .
          Hide
          Bertrand Dunogier added a comment -

          Merged to master@2288b95.

          Show
          Bertrand Dunogier added a comment - Merged to master@2288b95 .
          Hide
          Rui Silva (Inactive) added a comment -

          Tested and approved by QA for master.

          Show
          Rui Silva (Inactive) added a comment - Tested and approved by QA for master.

            People

            • Assignee:
              Unassigned
              Reporter:
              Mateusz Hyndle (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: