Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing a route object in provider based url generator fails for error messages #8394

Closed
dawehner opened this issue Jul 1, 2013 · 3 comments

Comments

@dawehner
Copy link
Contributor

dawehner commented Jul 1, 2013

Provider based url generators allow you to pass in not just the name of the route,
but also the route object itself.

    public function generate($name, $parameters = array(), $absolute = false)  {
    if ($name instanceof SymfonyRoute) {
        $route = $name;
    } elseif (null === $route = $this->provider->getRouteByName($name, $parameters)) {
        throw new RouteNotFoundException(sprintf('Route "%s" does not exist.', $name));
    }

If you do that the doGenerate() method is called on the base url generator, which then potentially uses this $route object in the debug messages and break.

Idea: Use getRouteDebugMessage() in the base url generator somehow

This problem causes issues for Drupal: https://drupal.org/node/2031353#comment-7602521

@dawehner
Copy link
Contributor Author

dawehner commented Jul 1, 2013

dawehner@71c2f63 is a basic test, but this does not reproduce the problem yet

@stof
Copy link
Member

stof commented Jul 1, 2013

Provider based generators are part of the Symfony CMF project, not of the core Symfony. Please report it to their team: https://github.com/symfony-cmf/Routing/issues

@stof stof closed this as completed Jul 1, 2013
@dawehner
Copy link
Contributor Author

dawehner commented Jul 1, 2013

symfony-cmf/Routing#65

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants