Browse Source

merged branch asm89/subrequest-request-method (PR #3657)

Commits
-------

c1206c3 [FrameworkBundle] Subrequests should always use GET method

Discussion
----------

[FrameworkBundle] Subrequests should always use GET method

Bug fix: yes
Feature addition: no
Backwards compatibility break: maybe?
Symfony2 tests pass: [![Build Status](https://secure.travis-ci.org/asm89/symfony.png?branch=subrequest-request-method)](http://travis-ci.org/asm89/symfony)
Fixes the following tickets: -
Todo: -

When generating a subrequest using the bundle/controller notation instead of a url, the method of the duplicated subrequest isn't set to GET, while this does happen in the other case (see [here](https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php#L143)). This causes weird behavior when embedding actions with forms on a page that is already reached through a POST request (since most forms check if POST was the request method before binding to the request).
Fabien Potencier 13 years ago
parent
commit
0eddc4a507
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/Symfony/Bundle/FrameworkBundle/HttpKernel.php

+ 1 - 0
src/Symfony/Bundle/FrameworkBundle/HttpKernel.php

@@ -140,6 +140,7 @@ class HttpKernel extends BaseHttpKernel
 
             $options['attributes']['_route'] = '_internal';
             $subRequest = $request->duplicate($options['query'], null, $options['attributes']);
+            $subRequest->setMethod('GET');
         }
 
         $level = ob_get_level();