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

eZRest v2 : Creating objects on postgres do not work

    XMLWordPrintable

Details

    Description

      Making objects do not work on postgres. Here an example using ezinteger

      Creating the contenttype ( works )

      #################### - Client request BEGIN - #########################
      POST /api/ezp/v2/content/typegroups/1/types?publish=true HTTP/1.1
      Host: ezpublish5.debian6.qa.ez.local:8080
      User-Agent: eZ REST QA Tester
      Content-Length: 2230
      Authorization: Basic YWRtaW46cHVibGlzaA==
      Accept: application/vnd.ez.api.ContentType+json
      Content-type: application/vnd.ez.api.ContentTypeCreate+json
      
      {
          "ContentTypeCreate": {
              "identifier": "TContentType",
              "mainLanguageCode": "eng-GB",
              "urlAliasSchema": "<name>",
              "nameSchema": "<name>",
              "isContainer": "true",
              "defaultSortField": "PATH",
              "defaultSortOrder": "ASC",
              "defaultAlwaysAvailable": "true",
              "names": {
              "value": [
                  {
                  "_languageCode": "eng-GB",
                  "#text": "RESTv2DatatypeTest"
                  }
              ]
              },
              "descriptions": {
              "value": [
                  {
                  "_languageCode": "eng-GB",
                  "#text": "This is a description"
                  }
              ]
              },
              "FieldDefinitions": {
              "FieldDefinition": [
                  {
                  "identifier": "name",
                  "fieldType": "ezstring",
                  "names": {
                      "value": [
                      {
                          "_languageCode": "eng-GB",
                          "#text": "Name"
                      }
                      ]
                  },
                  "descriptions": {
                      "value": [
                      {
                          "_languageCode": "eng-GB",
                          "#text": "This is the name"
                      }
                      ]
                  },
                  "fieldGroup": "content",
                  "position": "1",
                  "isTranslatable": "true",
                  "isRequired": "true",
                  "isInfoCollector": "false",
                  "isSearchable": "true",
                  "defaultValue": "New Name"
                  }
                  ,
              {
                "identifier": "integer",
                "fieldType": "ezinteger",
                "names": {
                  "value": [
                    {
                      "_languageCode": "eng-GB",
                      "#text": "Integer"
                    }
                  ]
                },
                "descriptions": {
                  "value": [
                    {
                      "_languageCode": "eng-GB",
                      "#text": "This is a ezinteger test"
                    }
                  ]
                },
                "fieldGroup": "content",
                "position": "2",
                "isTranslatable": "true",
                "isRequired": "false",
                "isInfoCollector": "false",
                "isSearchable": "true"
                
              }
              ]
              }
          }
        }
      
      
      ##################### - Client request END - ##########################
      sending to target...done.
      Received from Target:
      ##################### - Target reply BEGIN - ##########################
      HTTP/1.1 201 Created
      Date: Wed, 24 Apr 2013 12:44:53 GMT
      Server: Apache/2.2.16 (Debian)
      X-Powered-By: PHP/5.3.3-7+squeeze8
      Location: /api/ezp/v2/content/types/48
      Status: 201 Created
      Cache-Control: no-cache
      Transfer-Encoding: chunked
      Content-Type: application/vnd.ez.api.ContentType+json
      
      8bd
      {"ContentType":{"_media-type":"application\/vnd.ez.api.ContentType+json","_href":"\/api\/ezp\/v2\/content\/types\/48","id":48,"status":"DEFINED","identifier":"TContentType","names":{"value":[{"_languageCode":"eng-GB","#text":"RESTv2DatatypeTest"}]},"descriptions":{"value":[{"_languageCode":"eng-GB","#text":"This is a description"}]},"creationDate":"2013-04-24T14:44:53+02:00","modificationDate":"2013-04-24T14:44:53+02:00","Creator":{"_media-type":"application\/vnd.ez.api.User+json","_href":"\/api\/ezp\/v2\/user\/users\/14"},"Modifier":{"_media-type":"application\/vnd.ez.api.User+json","_href":"\/api\/ezp\/v2\/user\/users\/14"},"remoteId":"8cbe31d7d5dcca00fc1fae8553c039d7","urlAliasSchema":"<name>","nameSchema":"<name>","isContainer":"true","mainLanguageCode":"eng-GB","defaultAlwaysAvailable":"true","defaultSortField":"PATH","defaultSortOrder":"ASC","FieldDefinitions":{"_media-type":"application\/vnd.ez.api.FieldDefinitionList+json","_href":"\/api\/ezp\/v2\/content\/types\/48\/fieldDefinitions","FieldDefinition":[{"_media-type":"application\/vnd.ez.api.FieldDefinition+json","_href":"\/api\/ezp\/v2\/content\/types\/48\/fieldDefinitions\/347","id":347,"identifier":"name","fieldType":"ezstring","fieldGroup":"content","position":1,"isTranslatable":"true","isRequired":"true","isInfoCollector":"false","defaultValue":"New Name","isSearchable":"true","names":{"value":[{"_languageCode":"eng-GB","#text":"Name"}]},"descriptions":{"value":[{"_languageCode":"eng-GB","#text":"This is the name"}]},"fieldSettings":[],"validatorConfiguration":{"StringLengthValidator":{"maxStringLength":false,"minStringLength":false}}},{"_media-type":"application\/vnd.ez.api.FieldDefinition+json","_href":"\/api\/ezp\/v2\/content\/types\/48\/fieldDefinitions\/348","id":348,"identifier":"integer","fieldType":"ezinteger","fieldGroup":"content","position":2,"isTranslatable":"true","isRequired":"false","isInfoCollector":"false","defaultValue":0,"isSearchable":"true","names":{"value":[{"_languageCode":"eng-GB","#text":"Integer"}]},"descriptions":{"value":[{"_languageCode":"eng-GB","#text":"This is a ezinteger test"}]},"fieldSettings":[],"validatorConfiguration":{"IntegerValueValidator":{"minIntegerValue":false,"maxIntegerValue":false}}}]}}}
      
      ###################### - Target reply END - ###########################
      

      Creating the object ( seems to work, but internaly it might not ? )

      #################### - Client request BEGIN - #########################
      POST /api/ezp/v2/content/objects HTTP/1.1
      Host: ezpublish5.debian6.qa.ez.local:8080
      User-Agent: eZ REST QA Tester
      Content-Length: 842
      Authorization: Basic YWRtaW46cHVibGlzaA==
      Accept: application/vnd.ez.api.Content+json
      Content-type: application/vnd.ez.api.ContentCreate+json
      
      {
        "ContentCreate": {
          "ContentType": {
            "_href": "/content/types/48"
          },
          "mainLanguageCode": "eng-GB",
          "LocationCreate": {
            "ParentLocation": {
              "_href": "/content/locations/1/2"
            },
            "priority": "0",
            "hidden": "false",
            "sortField": "PATH",
            "sortOrder": "ASC"
          },
          "Section": {
            "_href": "/content/sections/1"
          },
          "alwaysAvailable": "true",
          "User": {
              "_href": "/user/users/14"
          },
          "modificationDate": "2012-09-30T12:30:00",
          "fields": {
            "field": [
              {
                "fieldDefinitionIdentifier": "name",
                "languageCode": "eng-GB",
                "fieldValue": "testObject1"
              },{
                "fieldDefinitionIdentifier": "integer",
                "languageCode": "eng-GB",
                "fieldValue": 4252
              }
            ]
          }
        }
      }
      
      
      ##################### - Client request END - ##########################
      sending to target...done.
      Received from Target:
      ##################### - Target reply BEGIN - ##########################
      HTTP/1.1 201 Created
      Date: Wed, 24 Apr 2013 12:45:40 GMT
      Server: Apache/2.2.16 (Debian)
      X-Powered-By: PHP/5.3.3-7+squeeze8
      Accept-Patch: application/vnd.ez.api.ContentUpdate+json
      Location: /api/ezp/v2/content/objects/59
      Status: 201 Created
      Cache-Control: no-cache
      Transfer-Encoding: chunked
      Content-Type: application/vnd.ez.api.Content+json
      
      7a5
      {"Content":{"_media-type":"application\/vnd.ez.api.Content+json","_href":"\/api\/ezp\/v2\/content\/objects\/59","_remoteId":"ff1c33ab7d1afca794f37e7afbd850c2","_id":"59","ContentType":{"_media-type":"application\/vnd.ez.api.ContentType+json","_href":"\/api\/ezp\/v2\/content\/types\/48"},"Name":"testObject1","Versions":{"_media-type":"application\/vnd.ez.api.VersionList+json","_href":"\/api\/ezp\/v2\/content\/objects\/59\/versions"},"CurrentVersion":{"_media-type":"application\/vnd.ez.api.Version+json","_href":"\/api\/ezp\/v2\/content\/objects\/59\/currentversion","Version":{"_media-type":"application\/vnd.ez.api.Version+json","_href":"\/api\/ezp\/v2\/content\/objects\/59\/versions\/1","VersionInfo":{"id":"508","versionNo":1,"status":"DRAFT","modificationDate":"2012-09-30T12:30:00+02:00","Creator":{"_media-type":"application\/vnd.ez.api.User+json","_href":"\/api\/ezp\/v2\/user\/users\/14"},"creationDate":"2012-09-30T12:30:00+02:00","initialLanguageCode":"eng-GB","languageCodes":"eng-GB","names":{"value":[{"_languageCode":"eng-GB","#text":"testObject1"}]},"Content":{"_media-type":"application\/vnd.ez.api.ContentInfo+json","_href":"\/api\/ezp\/v2\/content\/objects\/59"}},"Fields":{"field":[{"id":"217","fieldDefinitionIdentifier":"name","languageCode":"eng-GB","fieldValue":"testObject1"},{"id":"218","fieldDefinitionIdentifier":"integer","languageCode":"eng-GB","fieldValue":4252}]},"Relations":{"_media-type":"application\/vnd.ez.api.RelationList+json","_href":"\/api\/ezp\/v2\/content\/objects\/59\/versions\/1\/relations","Relation":[]}}},"Section":{"_media-type":"application\/vnd.ez.api.Section+json","_href":"\/api\/ezp\/v2\/content\/sections\/1"},"Locations":{"_media-type":"application\/vnd.ez.api.LocationList+json","_href":"\/api\/ezp\/v2\/content\/objects\/59\/locations"},"Owner":{"_media-type":"application\/vnd.ez.api.User+json","_href":"\/api\/ezp\/v2\/user\/users\/14"},"mainLanguageCode":"eng-GB","alwaysAvailable":"true"}}
      
      ###################### - Target reply END - ###########################
      
      

      publish the object( do not work )

      #################### - Client request BEGIN - #########################
      PUBLISH /api/ezp/v2/content/objects/59/versions/1 HTTP/1.1
      Host: ezpublish5.debian6.qa.ez.local:8080
      User-Agent: eZ REST QA Tester
      Authorization: Basic YWRtaW46cHVibGlzaA==
      X-HTTP-Method-Override: PUBLISH
      
      
      ##################### - Client request END - ##########################
      sending to target...done.
      Received from Target:
      ##################### - Target reply BEGIN - ##########################
      HTTP/1.1 500 Internal Server Error
      Date: Wed, 24 Apr 2013 12:45:56 GMT
      Server: Apache/2.2.16 (Debian)
      X-Powered-By: PHP/5.3.3-7+squeeze8
      Status: 500 Internal Server Error
      Cache-Control: no-cache
      Connection: close
      Transfer-Encoding: chunked
      Content-Type: application/vnd.ez.api.ErrorMessage+xml
      
      11b4
      <?xml version="1.0" encoding="UTF-8"?>
      <ErrorMessage media-type="application/vnd.ez.api.ErrorMessage+xml">
       <errorCode>500</errorCode>
       <errorMessage>Internal Server Error</errorMessage>
       <errorDescription>Database error</errorDescription>
       <trace>#0 /var/www/ezpublish5/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/UrlAlias/Handler.php(156): eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Gateway\ExceptionConversion-&gt;insertRow(Array)
      #1 /var/www/ezpublish5/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Cache/UrlAliasHandler.php(47): eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Handler-&gt;publishUrlAliasForLocation(61, 2, 'testObject1', 'eng-GB', 1)
      #2 /var/www/ezpublish5/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Repository/ContentService.php(893): eZ\Publish\Core\Persistence\Cache\UrlAliasHandler-&gt;publishUrlAliasForLocation(61, 2, 'testObject1', 'eng-GB', 1, true)
      #3 /var/www/ezpublish5/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Repository/ContentService.php(1399): eZ\Publish\Core\Repository\ContentService-&gt;publishUrlAliasesForContent(Object(eZ\Publish\Core\Repository\Values\Content\Content))
      #4 /var/www/ezpublish5/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Repository/ContentService.php(1359): eZ\Publish\Core\Repository\ContentService-&gt;internalPublishVersion(Object(eZ\Publish\Core\Repository\Values\Content\VersionInfo))
      #5 /var/www/ezpublish5/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/SignalSlot/ContentService.php(416): eZ\Publish\Core\Repository\ContentService-&gt;publishVersion(Object(eZ\Publish\Core\Repository\Values\Content\VersionInfo))
      #6 /var/www/ezpublish5/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/REST/Server/Controller/Content.php(553): eZ\Publish\Core\SignalSlot\ContentService-&gt;publishVersion(Object(eZ\Publish\Core\Repository\Values\Content\VersionInfo))
      #7 [internal function]: eZ\Publish\Core\REST\Server\Controller\Content-&gt;publishVersion()
      #8 /var/www/ezpublish5/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php(129): call_user_func_array(Array, Array)
      #9 /var/www/ezpublish5/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php(73): Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
      #10 /var/www/ezpublish5/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/ContainerAwareHttpKernel.php(57): Symfony\Component\HttpKernel\HttpKernel-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
      #11 /var/www/ezpublish5/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(197): Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
      #12 /var/www/ezpublish5/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php(464): Symfony\Component\HttpKernel\Kernel-&gt;handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
      #13 /var/www/ezpublish5/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/HttpCache/HttpCache.php(60): Symfony\Component\HttpKernel\HttpCache\HttpCache-&gt;forward(Object(Symfony\Component\HttpFoundation\Request), true, NULL)
      #14 /var/www/ezpublish5/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php(244): Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache-&gt;forward(Object(Symfony\Component\HttpFoundation\Request), true)
      #15 /var/www/ezpublish5/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php(261): Symfony\Component\HttpKernel\HttpCache\HttpCache-&gt;pass(Object(Symfony\Component\HttpFoundation\Request), true)
      #16 /var/www/ezpublish5/vendor/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/HttpCache.php(38): Symfony\Component\HttpKernel\HttpCache\HttpCache-&gt;invalidate(Object(Symfony\Component\HttpFoundation\Request), true)
      #17 /var/www/ezpublish5/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php(190): eZ\Bundle\EzPublishCoreBundle\HttpCache-&gt;invalidate(Object(Symfony\Component\HttpFoundation\Request), true)
      #18 /var/www/ezpublish5/web/index.php(28): Symfony\Component\HttpKernel\HttpCache\HttpCache-&gt;handle(Object(Symfony\Component\HttpFoundation\Request))
      #19 {main}</trace>
       <file>/var/www/ezpublish5/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/UrlAlias/Gateway/ExceptionConversion.php</file>
       <line>220</line>
      </ErrorMessage>
      
      
      ###################### - Target reply END - ###########################
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            vidar.langseid@ibexa.co Vidar Langseid
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: