Skip to content

Loading…

Check if there's a _route request attribute before getting it #248

Merged
merged 1 commit into from

2 participants

@andrea-chris

Apparently Symfony doesn't add a _route parameter to subrequests (esi render call) so PropelParamConverter throw an error accessing getOption method on not-existent object on line 98.

@andrea-chris andrea-chris Check if there's a _route request attribute before getting it
Apparently Symfony doesn't add a _route parameter to subrequests (esi render call) so PropelParamConverter throw an error accessing getOption method on not-existent object on line 98.
c2a3c30
@havvg havvg merged commit 6083565 into propelorm:1.2

1 check passed

Details default The Travis CI build passed
@havvg
Propel member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 25, 2013
  1. @andrea-chris

    Check if there's a _route request attribute before getting it

    andrea-chris committed
    Apparently Symfony doesn't add a _route parameter to subrequests (esi render call) so PropelParamConverter throw an error accessing getOption method on not-existent object on line 98.
Showing with 1 addition and 1 deletion.
  1. +1 −1 Request/ParamConverter/PropelParamConverter.php
View
2 Request/ParamConverter/PropelParamConverter.php
@@ -94,7 +94,7 @@ public function apply(Request $request, ConfigurationInterface $configuration)
$options = $configuration->getOptions();
// Check route options for converter options, if there are non provided.
- if (empty($options) && $this->router && $configuration instanceof ParamConverter) {
+ if (empty($options) && $request->attributes->has('_route') && $this->router && $configuration instanceof ParamConverter) {
$converterOption = $this->router->getRouteCollection()->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.