• Register
0 votes
1.1k 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 52 views
52 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
0 answers 141 views
141 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 50 views
50 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 155 views
155 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
0 answers 28 views
28 views
Problem: I have fundamental knowledge in PHP. I have recently written a PHP script which connects to my database setup up with the MAMP. But it does not seem to be able to connect to my database. Each and every time I tried the script has failed with the below message ... ($myresult)) {                 echo $row['username'] . "<br>";         } else {                 echo "Fail";         } ?>
asked Jun 16, 2020 Raphael Pacheco 4.9k points
1 vote
1 answer 76 views
76 views
Problem : Recently I have joined my new project in PHP. I am beginner to PHP programming. I am facing below server error in my project. &ldquo;Localhost is currently unable to handle this request. http error 500&rdquo; I have already done a lot of research on above ... also tried to restart the server. But I can still see the same old above error message. Can somebody help in fixing above error?
asked Mar 31, 2020 morrisBson 3.2k points
0 votes
1 answer 25 views
25 views
Problem: I want to populate the employee dropdown list based on the position. It should be a list of the employees and their position. So I want to see see the employee name and then the position that this employee has done. Here's my php code. I don't know why it doesn't work. Can ... ">Cleaner</option>         </select>      <?php } ?>     <input type="submit" name="submit" value="Save"> </form>
asked Nov 2, 2020 RJ Lam 650 points
0 votes
2 answers 43 views
43 views
Hello, can someone help me with my first PHP code? I need to send data to my second page. I pasted my form here. <html> <head> <title>First Page</title> </head> <body> <form> <input type="text" name="name"> <button name="submit">Submit</button> </form> </body> </html> and here&rsquo;s my page2.php. <?php echo "Welcome ".$name." to my page."; ?>
asked Oct 26, 2020 RJ Lam 650 points
0 votes
1 answer 9 views
9 views
I am trying to obtain the latitude and longitude value from the address using PHP.
asked Sep 25, 2020 Daniel Anderson 4k points
0 votes
1 answer 20 views
20 views
I need to know how to get value of radio button in PHP from database. can some programmer from kodlogs help me sort out this issue?
asked Sep 25, 2020 Daniel Anderson 4k points