Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Update PropelParamConverter.php #251

Closed
wants to merge 1 commit into from

3 participants

@ylazarov

Some Bundle can change the original route name in collection. This happen after I use jms/i18n-routing-bundle. This bundle change original route collection name with locale. Example: en__US__route_name.

FatalErrorException: Error: Call to a member function getOption() on a non-object in /var/www/symfony2/project/vendor/propel/propel-bundle/Propel/PropelBundle/Request/ParamConverter/PropelParamConverter.php line 99

@ylazarov ylazarov Update PropelParamConverter.php
Some Bundle can change the original route name in collection. This happen after I use jms/i18n-routing-bundle. This bundle change original route collection name with locale. Example: en__US__route_name.

FatalErrorException: Error: Call to a member function getOption() on a non-object in /var/www/symfony2/project/vendor/propel/propel-bundle/Propel/PropelBundle/Request/ParamConverter/PropelParamConverter.php line 99
4b43be4
@jaugustin

@ylazarov could you add a unit test for your case and update the failing one ?

@havvg
Collaborator

Could you please rebase your commit and provide test for the changes?

@havvg havvg closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 30, 2013
  1. @ylazarov

    Update PropelParamConverter.php

    ylazarov authored
    Some Bundle can change the original route name in collection. This happen after I use jms/i18n-routing-bundle. This bundle change original route collection name with locale. Example: en__US__route_name.
    
    FatalErrorException: Error: Call to a member function getOption() on a non-object in /var/www/symfony2/project/vendor/propel/propel-bundle/Propel/PropelBundle/Request/ParamConverter/PropelParamConverter.php line 99
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  Request/ParamConverter/PropelParamConverter.php
View
2  Request/ParamConverter/PropelParamConverter.php
@@ -95,7 +95,7 @@ public function apply(Request $request, ConfigurationInterface $configuration)
// Check route options for converter options, if there are non provided.
if (empty($options) && $request->attributes->has('_route') && $this->router && $configuration instanceof ParamConverter) {
- $converterOption = $this->router->getRouteCollection()->get($request->attributes->get('_route'))->getOption('propel_converter');
+ $converterOption = $this->router->getOriginalRouteCollection()->get($request->attributes->get('_route'))->getOption('propel_converter');
if (!empty($converterOption[$configuration->getName()])) {
$options = $converterOption[$configuration->getName()];
}
Something went wrong with that request. Please try again.