Search code examples
symfony1symfony-1.4yaml

Routing issue with Symfony 1.4


I have to upgrade an application previously developed by other guys with Symphony 1.4.

Inside my action.class.php there are two different functions:

public function executeCreateTask(sfWebRequest $request) {...}
public function executeCreateEvent(sfWebRequest $request) {...}

and inside my routing.yml I have 2 routes:

evaluation_task_create:
 url:     /evaluation/:id/task/create
 class:   sfDoctrineRoute
 options: { model: Evaluation, type: object }
 param:   { module: evaluation, action: createTask, sf_format: html }
 requirements: { sf_method: post }

and

evaluation_event_create:
 url:     /evaluation/:evaluation_id/event/create
 class:   sfDoctrineRoute
 options: { model: CustomEvent, type: object }
 param:   { module: evaluation, action: createEvent, sf_format: html }
 requirements: { sf_method: post } 

The url http://www.mysite/evaluation/21/task/create works perfectly (Creates a new task)

The url http://www.mysite/evaluation/21/event/create returns an 404 error.

Any idea why I have this routing issue?


Solution

  • You need to be able to debug further, since you are not getting an sfError404Exception. Have you set debug to true in your ApplicationConfiguration? You can do this in your webdispatcher for your dev environment.

    $configuration = ProjectConfiguration::getApplicationConfiguration(
        'backend',
        'dev',
        true
    );
    

    And in your application's settings.yml:

    dev:
      error_reporting: <?php echo (E_ALL | E_STRICT)."\n" ?>
      web_debug: true
    

    And in your application's factories.yml make sure you have set

    dev:
      logger:
        param:
          loggers:
            sf_web_debug:
              param:
                xdebug_logging: true