OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums Forums OroPlatform OroPlatform – Programming Questions Update custom entity data using API PUT

This topic contains 7 replies, has 2 voices, and was last updated by  kelton23om 6 years, 1 month ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
  • #33408


    Hi oro’s guys,
    I have an issues when i try to update my custom entity using a REST API.

    I create an entity with my own controller, my own Form type and handler.. etc..
    To do that, i duplicate(almost) an existing case in the OroPlatform..

    My problem seems to appear during the processForm, where the form submit do not hydrate data from the Request.

    Do you have any idea where that is come from ?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Author
  • #33409

    Alexandr Smaga

    Hello @kelton23om!
    Could you please provide more details? Are you talking about REST api ? Are you working with named form ?




    Yes i talk about a REST API.. i try to build my own REST API to expose my Own webservices dedicates to my Custom entity.
    To do that, i decided to follow an example as in the NotesBundle.. and it’s work pretty well for “delete” and “get” web services, but i encouter a problem when i try to PUT or POST some data.
    After some explorations i realize that the problem come from the Form process method,
    the submit method to be more precise who did not do the job!

    I don’t really known why, but the model Object is never hydrated by the request data..
    whereas if i trace my request i can see form data in the parameter bag.

    i expect that explains a bit more the situation.

    thanks again to spend a bit of your time answer my questions :)


    Alexandr Smaga

    Can you share $this->form->getName(), var_dump(array_keys($this->form->all())) and var_dump($this->request->request->all()); ?



    Hi, of course here it is:





    Alexandr Smaga


    Please try to use




    I’m not sure to do the right thing, but i get a 404 error !!!




    I found from where my issue came…

    It’s because of the form service declaration and the way the RestController manage the request.

    in “Oro\Bundle\SoapBundle\Controller\Api\Rest\RestController” the “fixRequestAttributes” method handle the parameters from Request.

    the problem is that this method treats the request as a “GET” if the “Form” contains a name.

    And of course in my case i put a name in my form declaration, in the “service.yml”:

    So i just need to remove the name from the arguments like this:

    that’s it :)

    I’m not really sure about the meaning of the fixRequestAttributes method but it seems to have a quite strange behavior in my opinion!

    thanks again!! keep going your good work

Viewing 7 replies - 1 through 7 (of 7 total)

The forum ‘OroPlatform – Programming Questions’ is closed to new topics and replies.

You will be redirected to [title]. Would you like to continue?

Yes No