• Register
0 votes
1.5k 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

Please log in or register to answer this question.

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 2 views
2 views
Problem: Does anyone have any idea about this? >There are no commands defined in the "server" namespace.
asked 1 day ago Junia Phoebe 15.3k points
1 vote
1 answer 9 views
9 views
Problem : Help me to ignore this > The path "fos_user.from_email.address" cannot contain an empty value, but got null.
asked Apr 30 Abik Dey 4k points
0 votes
1 answer 30 views
30 views
Problem: the csrf token is invalid. please try to resubmit the form.
asked Feb 17 Dan phillip 4.8k points
0 votes
0 answers 217 views
217 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, 2020 Raphael Pacheco 4.9k points
1 vote
1 answer 83 views
83 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, 2020 Martin K 6.6k points
0 votes
1 answer 208 views
208 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, 2020 mphil 2.3k points
0 votes
1 answer 25 views
25 views
Problem: I have this error in prestashop 1.7.5, when a user pay (any payment method), the payment is made, but in the order confirmation page, I have a 500 error, the only information that i have is the log with the following message: Frontcontroller::init - Cart cannot ... Does anyone know how to fix this error? I've been standing on this for a few days to launch my e-commerce, Thanks in advance!
asked Apr 24 sumaiya simi 43.9k points
0 votes
1 answer 136 views
136 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, 2020 maddi86 5.4k points
0 votes
1 answer 5 views
5 views
Problem: Any solution to this problem? Unknown database type enum requested, doctrine\dbal\platforms\mysqlplatform may not support it.
asked Apr 24 PkGuy 23.5k points
0 votes
1 answer 22 views
22 views
Problem: I can't figure out with this error > class 'doctrine\dbal\driver\pdomysql\driver' not found
asked Mar 24 Azlan2020 2.4k points