Permalink
Browse files

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.
  • Loading branch information...
1 parent 2c0342f commit c2a3c3082d743a2528416abc3fb7d3cbf6aef100 @andrea-cristaudo andrea-cristaudo committed Sep 25, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 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()];

0 comments on commit c2a3c30

Please sign in to comment.