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

REST error when creating a contentwith multiple relations to the same content

    XMLWordPrintable

Details

    Description

      Steps to reproduce.

      • Create an object A with a richtext
      • Add in the rich text embed an object B
      • Add a new related object to the same object B
      • Publish object A

      Try to get object A with REST.
      An error 500 should say: "Unknown relation type 3."

      It seems that REST is not aware of bit masks in: https://github.com/ezsystems/ezpublish-kernel/blob/master/eZ/Publish/Core/REST/Server/Output/ValueObjectVisitor/RestRelation.php#L94

      Error log:

      {
          "ErrorMessage": {
              "_media-type": "application\/vnd.ez.api.ErrorMessage+json",
              "errorCode": 500,
              "errorMessage": "Internal Server Error",
              "errorDescription": "Unknown relation type 3.",
              "trace": "
      #0 \/home\/yan\/prog\/ezplatform\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Publish\/Core\/REST\/Server\/Output\/ValueObjectVisitor\/RestRelation.php(79): eZ\\Publish\\Core\\REST\\Server\\Output\\ValueObjectVisitor\\RestRelation->getRelationTypeString(3)\n#1 \/home\/yan\/prog\/ezplatform\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Publish\/Core\/REST\/Common\/Output\/ValueObjectVisitorDispatcher.php(73): eZ\\Publish\\Core\\REST\\Server\\Output\\ValueObjectVisitor\\RestRelation->visit(Object(eZ\\Publish\\Core\\REST\\Common\\Output\\Visitor), Object(eZ\\Publish\\Core\\REST\\Common\\Output\\Generator\\Json), Object(eZ\\Publish\\Core\\REST\\Server\\Values\\RestRelation))\n#2 \/home\/yan\/prog\/ezplatform\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Publish\/Core\/REST\/Common\/Output\/Visitor.php(142): eZ\\Publish\\Core\\REST\\Common\\Output\\ValueObjectVisitorDispatcher->visit(Object(eZ\\Publish\\Core\\REST\\Server\\Values\\RestRelation))\n#3 \/home\/yan\/prog\/ezplatform\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Publish\/Core\/REST\/Server\/Output\/ValueObjectVisitor\/RelationList.php(51): eZ\\Publish\\Core\\REST\\Common\\Output\\Visitor->visitValueObject(Object(eZ\\Publish\\Core\\REST\\Server\\Values\\RestRelation))\n#4 \/home\/yan\/prog\/ezplatform\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Publish\/Core\/REST\/Common\/Output\/ValueObjectVisitorDispatcher.php(73): eZ\\Publish\\Core\\REST\\Server\\Output\\ValueObjectVisitor\\RelationList->visit(Object(eZ\\Publish\\Core\\REST\\Common\\Output\\Visitor), Object(eZ\\Publish\\Core\\REST\\Common\\Output\\Generator\\Json), Object(eZ\\Publish\\Core\\REST\\Server\\Values\\RelationList))\n#5 \/home\/yan\/prog\/ezplatform\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Publish\/Core\/REST\/Common\/Output\/Visitor.php(142): eZ\\Publish\\Core\\REST\\Common\\Output\\ValueObjectVisitorDispatcher->visit(Object(eZ\\Publish\\Core\\REST\\Server\\Values\\RelationList))\n#6 \/home\/yan\/prog\/ezplatform\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Publish\/Core\/REST\/Server\/Output\/ValueObjectVisitor\/Version.php(88): eZ\\Publish\\Core\\REST\\Common\\Output\\Visitor->visitValueObject(Object(eZ\\Publish\\Core\\REST\\Server\\Values\\RelationList))\n#7 \/home\/yan\/prog\/ezplatform\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Publish\/Core\/REST\/Common\/Output\/ValueObjectVisitorDispatcher.php(73): eZ\\Publish\\Core\\REST\\Server\\Output\\ValueObjectVisitor\\Version->visit(Object(eZ\\Publish\\Core\\REST\\Common\\Output\\Visitor), Object(eZ\\Publish\\Core\\REST\\Common\\Output\\Generator\\Json), Object(eZ\\Publish\\Core\\REST\\Server\\Values\\Version))\n#8 \/home\/yan\/prog\/ezplatform\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Publish\/Core\/REST\/Common\/Output\/Visitor.php(142): eZ\\Publish\\Core\\REST\\Common\\Output\\ValueObjectVisitorDispatcher->visit(Object(eZ\\Publish\\Core\\REST\\Server\\Values\\Version))\n#9 \/home\/yan\/prog\/ezplatform\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Publish\/Core\/REST\/Server\/Output\/ValueObjectVisitor\/RestContent.php(98): eZ\\Publish\\Core\\REST\\Common\\Output\\Visitor->visitValueObject(Object(eZ\\Publish\\Core\\REST\\Server\\Values\\Version))\n#10 \/home\/yan\/prog\/ezplatform\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Publish\/Core\/REST\/Common\/Output\/ValueObjectVisitorDispatcher.php(73): eZ\\Publish\\Core\\REST\\Server\\Output\\ValueObjectVisitor\\RestContent->visit(Object(eZ\\Publish\\Core\\REST\\Common\\Output\\Visitor), Object(eZ\\Publish\\Core\\REST\\Common\\Output\\Generator\\Json), Object(eZ\\Publish\\Core\\REST\\Server\\Values\\RestContent))\n#11 \/home\/yan\/prog\/ezplatform\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Publish\/Core\/REST\/Common\/Output\/Visitor.php(142): eZ\\Publish\\Core\\REST\\Common\\Output\\ValueObjectVisitorDispatcher->visit(Object(eZ\\Publish\\Core\\REST\\Server\\Values\\RestContent))\n#12 \/home\/yan\/prog\/ezplatform\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Publish\/Core\/REST\/Server\/Output\/ValueObjectVisitor\/CachedValue.php(41): eZ\\Publish\\Core\\REST\\Common\\Output\\Visitor->visitValueObject(Object(eZ\\Publish\\Core\\REST\\Server\\Values\\RestContent))\n#13 \/home\/yan\/prog\/ezplatform\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Publish\/Core\/REST\/Common\/Output\/ValueObjectVisitorDispatcher.php(73): eZ\\Publish\\Core\\REST\\Server\\Output\\ValueObjectVisitor\\CachedValue->visit(Object(eZ\\Publish\\Core\\REST\\Common\\Output\\Visitor), Object(eZ\\Publish\\Core\\REST\\Common\\Output\\Generator\\Json), Object(eZ\\Publish\\Core\\REST\\Server\\Values\\CachedValue))\n#14 \/home\/yan\/prog\/ezplatform\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Publish\/Core\/REST\/Common\/Output\/Visitor.php(142): eZ\\Publish\\Core\\REST\\Common\\Output\\ValueObjectVisitorDispatcher->visit(Object(eZ\\Publish\\Core\\REST\\Server\\Values\\CachedValue))\n#15 \/home\/yan\/prog\/ezplatform\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Publish\/Core\/REST\/Common\/Output\/Visitor.php(104): eZ\\Publish\\Core\\REST\\Common\\Output\\Visitor->visitValueObject(Object(eZ\\Publish\\Core\\REST\\Server\\Values\\CachedValue))\n#16 \/home\/yan\/prog\/ezplatform\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Publish\/Core\/REST\/Server\/View\/AcceptHeaderVisitorDispatcher.php(58): eZ\\Publish\\Core\\REST\\Common\\Output\\Visitor->visit(Object(eZ\\Publish\\Core\\REST\\Server\\Values\\CachedValue))\n#17 \/home\/yan\/prog\/ezplatform\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Bundle\/EzPublishRestBundle\/EventListener\/ResponseListener.php(63): eZ\\Publish\\Core\\REST\\Server\\View\\AcceptHeaderVisitorDispatcher->dispatch(Object(Symfony\\Component\\HttpFoundation\\Request), Object(eZ\\Publish\\Core\\REST\\Server\\Values\\CachedValue))\n#18 [internal function]: eZ\\Bundle\\EzPublishRestBundle\\EventListener\\ResponseListener->onKernelResultView(Object(Symfony\\Component\\HttpKernel\\Event\\GetResponseForControllerResultEvent), 'kernel.view', Object(Symfony\\Component\\HttpKernel\\Debug\\TraceableEventDispatcher))\n#19 \/home\/yan\/prog\/ezplatform\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/EventDispatcher\/Debug\/WrappedListener.php(61): call_user_func(Array, Object(Symfony\\Component\\HttpKernel\\Event\\GetResponseForControllerResultEvent), 'kernel.view', Object(Symfony\\Component\\HttpKernel\\Debug\\TraceableEventDispatcher))\n#20 [internal function]: Symfony\\Component\\EventDispatcher\\Debug\\WrappedListener->__invoke(Object(Symfony\\Component\\HttpKernel\\Event\\GetResponseForControllerResultEvent), 'kernel.view', Object(Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher))\n#21 \/home\/yan\/prog\/ezplatform\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/EventDispatcher\/EventDispatcher.php(164): call_user_func(Object(Symfony\\Component\\EventDispatcher\\Debug\\WrappedListener), Object(Symfony\\Component\\HttpKernel\\Event\\GetResponseForControllerResultEvent), 'kernel.view', Object(Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher))\n#22 \/home\/yan\/prog\/ezplatform\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/EventDispatcher\/EventDispatcher.php(53): Symfony\\Component\\EventDispatcher\\EventDispatcher->doDispatch(Array, 'kernel.view', Object(Symfony\\Component\\HttpKernel\\Event\\GetResponseForControllerResultEvent))\n#23 \/home\/yan\/prog\/ezplatform\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/EventDispatcher\/ContainerAwareEventDispatcher.php(167): Symfony\\Component\\EventDispatcher\\EventDispatcher->dispatch('kernel.view', Object(Symfony\\Component\\HttpKernel\\Event\\GetResponseForControllerResultEvent))\n#24 \/home\/yan\/prog\/ezplatform\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/EventDispatcher\/Debug\/TraceableEventDispatcher.php(124): Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher->dispatch('kernel.view', Object(Symfony\\Component\\HttpKernel\\Event\\GetResponseForControllerResultEvent))\n#25 \/home\/yan\/prog\/ezplatform\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/HttpKernel\/HttpKernel.php(152): Symfony\\Component\\EventDispatcher\\Debug\\TraceableEventDispatcher->dispatch('kernel.view', Object(Symfony\\Component\\HttpKernel\\Event\\GetResponseForControllerResultEvent))\n#26 \/home\/yan\/prog\/ezplatform\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/HttpKernel\/HttpKernel.php(68): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw(Object(Symfony\\Component\\HttpFoundation\\Request), 1)\n#27 \/home\/yan\/prog\/ezplatform\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/HttpKernel\/DependencyInjection\/ContainerAwareHttpKernel.php(69): Symfony\\Component\\HttpKernel\\HttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#28 \/home\/yan\/prog\/ezplatform\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/HttpKernel\/Kernel.php(196): Symfony\\Component\\HttpKernel\\DependencyInjection\\ContainerAwareHttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#29 \/home\/yan\/prog\/ezplatform\/web\/index.php(66): Symfony\\Component\\HttpKernel\\Kernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request))\n#30 {main}",
              "file": "\/home\/yan\/prog\/ezplatform\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Publish\/Core\/REST\/Server\/Output\/ValueObjectVisitor\/RestRelation.php",
              "line": 105
          }
      }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            yannick.roger-obsolete@ez.no Yannick Roger (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: