Details
-
Bug
-
Resolution: Fixed
-
High
-
5.2-dev, 5.3-dev
-
RHEL 6.4
PHP 5.3.3
Mysql 5.1.61
Description
Creating a view with the wrong schema will return a "500 Internal Server Error" it should be a 400
I've made the following request
Url: /api/ezp/v2/content/views Method: "POST" Headers: Content-Type: application/vnd.ez.api.ViewInput+json Accept: application/vnd.ez.api.View+json Body: {"ViewInput":{"identifierError":"some-test-id-1","public":false,"Query":{"Criteria":{"FullTextCriterion":"Article"},"offset":0,"FacetBuilders":{},"SortClauses":{},"spellcheck":false}}}
This is the response:
{"ErrorMessage":{"_media-type":"application\/vnd.ez.api.ErrorMessage+json","errorCode":500,"errorMessage":"Internal Server Error","errorDescription":"Missing <identifier> attribute for <ViewInput>.","trace":"#0 \/var\/www\/apache2php53\/ezp5\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Publish\/Core\/REST\/Common\/Input\/ParsingDispatcher.php(79): eZ\\Publish\\Core\\REST\\Server\\Input\\Parser\\ViewInput->parse(Array, Object(eZ\\Publish\\Core\\REST\\Common\\Input\\ParsingDispatcher))\n#1 \/var\/www\/apache2php53\/ezp5\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Publish\/Core\/REST\/Common\/Input\/Dispatcher.php(112): eZ\\Publish\\Core\\REST\\Common\\Input\\ParsingDispatcher->parse(Array, 'application\/vnd...')\n#2 \/var\/www\/apache2php53\/ezp5\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Publish\/Core\/REST\/Server\/Controller\/Content.php(710): eZ\\Publish\\Core\\REST\\Common\\Input\\Dispatcher->parse(Object(eZ\\Publish\\Core\\REST\\Common\\Message))\n#3 [internal function]: eZ\\Publish\\Core\\REST\\Server\\Controller\\Content->createView()\n#4 \/var\/www\/apache2php53\/ezp5\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/HttpKernel\/HttpKernel.php(129): call_user_func_array(Array, Array)\n#5 \/var\/www\/apache2php53\/ezp5\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/HttpKernel\/HttpKernel.php(73): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw(Object(Symfony\\Component\\HttpFoundation\\Request), 1)\n#6 \/var\/www\/apache2php53\/ezp5\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/HttpKernel\/DependencyInjection\/ContainerAwareHttpKernel.php(57): Symfony\\Component\\HttpKernel\\HttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#7 \/var\/www\/apache2php53\/ezp5\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/HttpKernel\/Kernel.php(199): Symfony\\Component\\HttpKernel\\DependencyInjection\\ContainerAwareHttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#8 \/var\/www\/apache2php53\/ezp5\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Bundle\/EzPublishCoreBundle\/Kernel.php(62): Symfony\\Component\\HttpKernel\\Kernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#9 \/var\/www\/apache2php53\/ezp5\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/HttpKernel\/HttpCache\/HttpCache.php(473): eZ\\Bundle\\EzPublishCoreBundle\\Kernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#10 \/var\/www\/apache2php53\/ezp5\/vendor\/symfony\/symfony\/src\/Symfony\/Bundle\/FrameworkBundle\/HttpCache\/HttpCache.php(60): Symfony\\Component\\HttpKernel\\HttpCache\\HttpCache->forward(Object(Symfony\\Component\\HttpFoundation\\Request), true, NULL)\n#11 \/var\/www\/apache2php53\/ezp5\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/HttpKernel\/HttpCache\/HttpCache.php(244): Symfony\\Bundle\\FrameworkBundle\\HttpCache\\HttpCache->forward(Object(Symfony\\Component\\HttpFoundation\\Request), true)\n#12 \/var\/www\/apache2php53\/ezp5\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/HttpKernel\/HttpCache\/HttpCache.php(261): Symfony\\Component\\HttpKernel\\HttpCache\\HttpCache->pass(Object(Symfony\\Component\\HttpFoundation\\Request), true)\n#13 \/var\/www\/apache2php53\/ezp5\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Bundle\/EzPublishCoreBundle\/HttpCache.php(57): Symfony\\Component\\HttpKernel\\HttpCache\\HttpCache->invalidate(Object(Symfony\\Component\\HttpFoundation\\Request), true)\n#14 \/var\/www\/apache2php53\/ezp5\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/HttpKernel\/HttpCache\/HttpCache.php(190): eZ\\Bundle\\EzPublishCoreBundle\\HttpCache->invalidate(Object(Symfony\\Component\\HttpFoundation\\Request), true)\n#15 \/var\/www\/apache2php53\/ezp5\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Bundle\/EzPublishCoreBundle\/HttpCache.php(36): Symfony\\Component\\HttpKernel\\HttpCache\\HttpCache->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#16 \/var\/www\/apache2php53\/ezp5\/web\/index.php(59): eZ\\Bundle\\EzPublishCoreBundle\\HttpCache->handle(Object(Symfony\\Component\\HttpFoundation\\Request))\n#17 {main}","file":"\/var\/www\/apache2php53\/ezp5\/vendor\/ezsystems\/ezpublish-kernel\/eZ\/Publish\/Core\/REST\/Server\/Input\/Parser\/ViewInput.php","line":41}}