This topic contains 2 replies, has 2 voices, and was last updated by Rodolfo 8 years, 10 months ago.
- Topic
Hello!
I’m stuck on this is the error:
{“code”:400,”message”:”Validation Failed”,”errors”:{“errors”:[“This form should not contain extra fields.”],”children”:{“owner”:[]}}}string(156) “Client error response [url] http://acme.dev/api/rest/latest/physicalstore/accounts.json [status code] 400 [reason phrase] Bad Request”
string(0) “”This is my client using GuzzleHttp and I’m passing only the required fields:
12345678910111213$response = $oroClient->post('api/rest/latest/physicalstore/accounts.json', ['body' => ['custno' => 'AAAAA','contact' => 'AAAAA AAAAA','city' => 'My City','phone' => '9999999','email' => 'aaaaa@example.org','owner' => '1','organization' => '1']]);I created this POST using the field structure that I’m receiving when I call CGET method. Even having a Owner and Organization id on the database table, Rest are returning empty values.. I’m not sure why..
12345678910111213141516171819202122232425262728293031323334Array([0] => stdClass Object([id] => 1[custno] => ABC[company] =>[contact] => MY NAME[title] =>[address1] =>[address2] =>[city] =>[addrstate] =>[zip] =>[country] =>[phone] =>[phone2] =>[source] =>[type] =>[email] => abc@example.org[custmemo] =>[url] =>[created] =>[updated] =>[owner] => stdClass Object()[organization] => stdClass Object()))Do you guys have any idea what’s wrong?
This is some pieces of my Entity Class:
12345678910111213141516* "security"={* "type"="ACL"* },* "ownership"={* "owner_type"="USER",* "owner_field_name"="owner",* "owner_column_name"="user_owner_id",* "organization_field_name"="organization",* "organization_column_name"="organization_id"* }* }* )*/class OroPhysicalStoreAccounts…
1234567891011121314/*** @var User* @ORM\ManyToOne(targetEntity="Oro\Bundle\UserBundle\Entity\User")* @ORM\JoinColumn(name="user_owner_id", referencedColumnName="id", onDelete="SET NULL")* @ConfigField(* defaultValues={* "importexport"={* "excluded"=true* }* }* )*/protected $owner;…
123456789101112/*** @param User $owner* @return OroPhysicalStoreAccounts*/public function setOwner(User $owner = null){$this->owner = $owner;return $this;}
The forum ‘OroPlatform – Programming Questions’ is closed to new topics and replies.