Ladies and gentlemen, 
 
I'm having again some trouble with the routing in symfony and I'm stuck.
Any help would be appreciated. 
Here is the problem : 
 
1/ My logs shows the following line, indicating that the url clicked is
parsed : 
Apr 23 15:50:02 symfony [info] {sfPatternRouting} Match route
"vitrine_remove_paragraphe" (/vitrine/removeParagraphe/:id_paragraphe)
for /vitrine/removeParagraphe/196 with parameters array (  'module' =>
'vitrine',  'action' => 'removeParagraphe',  'id_paragraphe' => '196',)
 
2/ The correct action is called : 
Apr 23 15:50:03 symfony [info] {vitrineActions} Call
"vitrineActions->executeRemoveParagraphe()"
 
3/ In my routing.yml, the route is declared like this : 
vitrine_remove_paragraphe:
  url: vitrine/removeParagraphe/:id_paragraphe
  class: sfDoctrineRoute
  options: { model: VitrineParagraphe, type: object }
  params: { module: vitrine, action: removeParagraphe }
  requirements: { id_paragraphe: \d+, sf_method: [DELETE] }

so I expect symfony to pass a VitrineParagraphe object with id 196 to
the action. 
 
Unfortunately, the log also shows this : 
Apr 23 15:50:03 symfony [info] {Doctrine_Connection_Mysql} query :
SELECT v.id AS v__id, v.vitrine_id AS v__vitrine_id, v.libelle AS
v__libelle, v.rang AS v__rang, v.created_at AS v__created_at,
v.updated_at AS v__updated_at FROM vitrine_paragraphe v - ()

The request has been passed as if my params were declaring a list, not
an object. And of course, when I call
 
$this->getRoute()->getObject() 
 
in my action, I retrieve the first VitrineParagraphe object in the list,
which is of course not the one I want to delete. 
 
The odd point is that I'm using this exact pattern on another module and
it works. 
So : what am I doing wrong here ? 
 
 
 

 
 

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to