Problème (404 | Not Found | sfError404Exception) après enregistrement validation formulaire
Bonjour,
J'ai créé un formulaire pour créer des annonces.
J'ai cette erreur lors de la validation du formulaire après avoir saisi tous les champs:
404 | Not Found | sfError404Exception
Unable to find the Annonce object with the following parameters "array ( 'sf_format' => 'html',)").
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
at ()
in SF_ROOT_DIR\lib\vendor\symfony\lib\routing\sfObjectRoute.class.php line 111 ...
// check the related object
if (!($this->object = $this->getObjectForParameters($this->parameters)) && (!isset($this->options['allow_empty']) || !$this->options['allow_empty']))
{
throw new sfError404Exception(sprintf('Unable to find the %s object with the following parameters "%s").', $this->options['model'], str_replace("\n", '', var_export($this->filterParameters($this->parameters), true))));
}
return $this->object; |
at sfObjectRoute->getObject()
in SF_ROOT_DIR\apps\frontend\modules\ads\actions\actions.class.php line 57
Code:
1 2 3 4 5 6 7 8 9 10 11 12
|
public function executeCreate(sfWebRequest $request)
{
$this->forward404Unless($request->isMethod(sfRequest::POST));
$this->annonce = $this->getRoute()->getObject();// ligne 57
$this->annonce->setUtilisateur_id($this->getUser()->getAttribute('id'));
$this->form = new AnnonceForm($this->annonce); |
Mon routing.yml
Code:
1 2 3 4 5 6 7 8 9
|
ads:
class: sfDoctrineRouteCollection
options:
model: Annonce
module: ads
prefix_path: /ads
column: id
with_wildcard_routes: true |
Je suis vraiment coincé je ne sais pas pourquoi cette erreur sors maintenant avant je créais une Annonce sans aucun soucis.
J'avais presque rien modifier.
Merci de m'aider si vous avez une petite idée.