• Register
0 votes
657 views

Problem :

I am facing following error "500 Internal Server Error - LogicException: Unable to guess how to get a Doctrine instance from the request information".

Below is my controller action definition:

/**
 * @Route("/gatheractor/{actor_name}/{gather_id}")
 * @Template()
 */
public function createActorAction(Actor $actor, Gather $gather)
{
  // ...
}

How can I fix the above error?

8 4 2
2,300 points

1 Answer

0 votes

Solution :

I have read your question which you have posted in this forum. Dealing with Doctrine is very tricky thing. I had also faced the issue in the past. So I am trying to help you in resolving your issue.

I think parameters on a signature of a @Route annotation must be matching with the entities fields, so that the Doctrine makes the automatically conversion.

Or else you will need to do a conversion manually by using a following annotation @ParamConverter.

Your Doctrine will not know how to use your request parameters to query the entities which you have specified in your function's signature.

So you must help it by just specifying some of the mapping information as shown below:

/**
  * @Route("/gatheractor /{ actor_name }/{gather_id}")
  *
  * @ParamConverter("actor", options={"mapping": {" actor_name " : "name"}})
  * @ParamConverter("gather", options={"mapping": {"gather_id"   : "id"}})
  *
  * @Template()
  */
public function createActorAction(Actor $actor, Gather $gather)
{
  // ...
}

 

5 2 1
4,980 points

Related questions

0 votes
1 answer 35 views
35 views
Problem: I am new, I need help, can anyone help me by filling in the blanks? A ____ is a question, or, in database terms, a request for specific information from the database?
asked Feb 19 maddi86 5.4k points
0 votes
0 answers 76 views
76 views
Problem: I have elementary knowledge of php, symphony, fosuserbundle. I am currently trying to update the doctrine schema after the installation of FOSUser Bundle 2.0 but since then I keep getting below error: In ArrayNode.php line 238: The child node " ... the steps accurately from the online tutorial. Still I am facing the same error. Any clues in fixing above fosuserbundle related error?
asked Jun 16 Raphael Pacheco 4.9k points
1 vote
1 answer 33 views
33 views
Problem : I am very new to FOS user bundle. Currently I am facing a big problem related to installing FOS user bundle. I have already tried to search for its fix everywhere but still unable to find the fix' I have already created the entity which is called as ... : AppBundle\Entity\Admin Above error have wasted a lot of my time. So now looking for expert who can fix the FOS related error.
asked May 20 Martin K 6.6k points
0 votes
1 answer 81 views
81 views
Problem : Currently I am learning Symfony. I am trying to use the "php bin/console generate:bundle" command to create the bundle but even after leaving everything by default I always face below error: The command was not able to configure everything automatically. You' ... everything by default means I just enter a bundle name and after that I just keep pressing the enter until that process ends.
asked Feb 19 mphil 2.3k points
0 votes
1 answer 6 views
6 views
I am trying to obtain the latitude and longitude value from the address using PHP.
asked Sep 25 Daniel Anderson 4k points