This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes#8363).
Discussion
----------
typo first->second
Commits
-------
2d9a84b typo first->second
This PR was submitted for the 2.3 branch but it was merged into the 2.2 branch instead (closes#8310).
Discussion
----------
[FrameworkBundle] Fixed variable name used in translation cache
This simply fixes the `$catalogueXXX` variable name used in the translation cache files in case the user use locales such as `en-US`, the generated variable's name was `$catalogueEn-Us`, with this fix it will be `$catalogueEnUs`.
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #7824
| License | MIT
| Doc PR | -
Commits
-------
e50399c [FrameworkBundle] Fixed variable name used in translation cache
This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes#8337).
Discussion
----------
Fix grammar
Commits
-------
4163f71 Fix grammar
This PR was merged into the 2.2 branch.
Discussion
----------
[WebProfilerBundle] force the Content-Type to html in the web profiler controllers
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | [![Build Status](https://travis-ci.org/lsmith77/symfony.png?branch=force_content_type)](https://travis-ci.org/lsmith77/symfony)
| Fixed tickets | -
| License | MIT
| Doc PR | -
This just forces the Content-Type to match what will be returned, otherwise if the request format happens to be something else than HTML (which can be the case when building an app that only does JSON/XML with FOSRestBundle) it can happen that the Response class automatically sets a different Content-Type.
The approach taken here matches https://github.com/nelmio/NelmioApiDocBundle/blob/master/Controller/ApiDocController.php#L24
Commits
-------
6d2135b force the Content-Type to html in the web profiler controllers
This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes#8199).
Discussion
----------
[Console] Throw exception if value is passed to VALUE_NONE input optin, long syntax
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | yes
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #8135
| License | MIT
Input options with InputOption::VALUE_NONE accept values in both short and long syntaxes:
- When using the long syntax, no exception is thrown;
- When using short, a "The %s option does not exist" exception is thrown.
This PR only addresses the long syntax case. The short syntax case would require considerable refactoring of the parse code, which I believe should be discussed.
I included a test that illustrates the above mentioned problem for the long syntax scenario.
Commits
-------
32ea77f Throw exception if value is passed to VALUE_NONE input, long syntax
This PR was submitted for the 2.1 branch but it was merged into the 2.2 branch instead (closes#8198).
Discussion
----------
[Form] fixed date type format pattern regex
| Q | A
| ------------- | ---
| Bug fix? | [yes]
| New feature? | [no]
| BC breaks? | [no]
| Deprecations? | [no]
| Tests pass? | [yes]
| License | MIT
I don't understand what is the rationale behind the current regex, why is there mandatory in-between characters?
The current regex passes with the format option set to ```dMyyyy``` while it doesn't with ```dMy```, on the linked icu documentation it is stated that ```y``` is equivalent to ```yyyy```.
So when setting this format option to dMy, fields are rendered in a wrong order because of the fallback (year, month, day).
Commits
-------
6a91bbb [Form] fixed date type format pattern regex
This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes#8242).
Discussion
----------
[FrameworkBundle] do not re-register commands each time a Console\Application is run
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
I have been experimenting with using the Symfony console application inside of a React event loop which works quite well.
In this scenario, I re-use an instances of a Console\Application to run multiple tasks. This works well apart from unnecessarily reloading the command classes from all included bundles each time doRun() is called (https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Console/Application.php#L68). This can also lead to running out of file descriptors under heavy load as bootstrap.php.cache uses a RecursiveDirectoryIterator to load the command.
Commits
-------
1983fc3 [FrameworkBundle] do not re-register commands each time a Console\Application is run
This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes#8227).
Discussion
----------
[Process] fix issue where $_ENV contains array vals
There are cases where $env or $_ENV can contain a value that is an array
This will cause Process to throw an Array to String conversion exception
Initially I submitted a patch of Process.php, however Fabien indicated
that it shouldn't be fixed there (see below pull request).
Before recently, a simple work around would be in php.ini to set:
register_argc_argv = On
However with recent changes, this seems to no longer work.
Original pull request: https://github.com/symfony/symfony/pull/7354
See ticket https://github.com/symfony/symfony/issues/7196
```
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | 7196
| License | MIT
| Doc PR | none
```
Commits
-------
2c6af95 [Process] fix issue where $_ENV contains array vals
There are cases where $env or $_ENV can contain a value that is an array
This will cause Process to throw an Array to String conversion exception
Initially I submitted a patch of Process.php, however Fabien indicated
that it shouldn't be fixed there (see below pull request).
Before recently, a simple work around would be in php.ini to set:
register_argc_argv = On
However with recent changes, this seems to no longer work.
Original pull request: https://github.com/symfony/symfony/pull/7354
See ticket https://github.com/symfony/symfony/issues/7196
This PR was merged into the 2.2 branch.
Discussion
----------
[DomCrawler] Fix handling file:// without a host
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Commits
-------
4139936 [DomCrawler] Fix handling file:// without a host
This PR was merged into the 2.2 branch.
Discussion
----------
[Finder] Fix SplFileInfo::getContents isn't working with ssh2 protocol
| Q | A
| -------------:| ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #8219
| License | MIT
Commits
-------
849f3ed [Finder] Fix SplFileInfo::getContents isn't working with ssh2 protocol
This PR was merged into the 2.2 branch.
Discussion
----------
[Form] corrected interface bind() method defined against in deprecation ...
...notice
The 'bind' method is defined against `FormInterface` not `FormConfigInterface`. This corrects the deprecation notice in the `Form` implementation.
Commits
-------
de289d2 [Form] corrected interface bind() method defined against in deprecation notice
* 2.1:
Revert "[Console] ensure exit code between 0-254"
[Console] ensure exit code between 0-254
[Console] fix status code when Exception::getCode returns something like 0.1
Fixed exit code for exceptions with error code 0
This PR was merged into the 2.1 branch.
Discussion
----------
[Console] fix status and exit code
Fix https://github.com/symfony/symfony/pull/8183#discussion_r4525267
and
http://www.php.net/manual/en/function.exit.php
> Exit statuses should be in the range 0 to 254, the exit status 255 is reserved by PHP and shall not be used. The status 0 is used to terminate the program successfully.
Commits
-------
6b9180a [Console] ensure exit code between 0-254
445b2e3 [Console] fix status code when Exception::getCode returns something like 0.1
This PR was merged into the 2.2 branch.
Discussion
----------
[DomCrawler] Fixed a fatal error when setting a value in a malformed field name
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Hi,
I found a case where a fatal error happen when trying to set a value in a form field with a malformed name.
```
Fatal error: Call to a member function setValue() on a non-object in /home/pierreyves/projects/symfony2/symfony/src/Symfony/Component/DomCrawler/FormFieldRegistry.php on line 128
Call Stack:
0.0001 231832 1. {main}() /home/pierreyves/projects/symfony2/symfony/vendor/phpunit/phpunit/composer/bin/phpunit:0
0.0035 688768 2. PHPUnit_TextUI_Command::main() /home/pierreyves/projects/symfony2/symfony/vendor/phpunit/phpunit/composer/bin/phpunit:63
0.0035 689000 3. PHPUnit_TextUI_Command->run() /home/pierreyves/projects/symfony2/symfony/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php:129
0.0224 2705448 4. PHPUnit_TextUI_TestRunner->doRun() /home/pierreyves/projects/symfony2/symfony/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php:176
0.0301 2997392 5. PHPUnit_Framework_TestSuite->run() /home/pierreyves/projects/symfony2/symfony/vendor/phpunit/phpunit/PHPUnit/TextUI/TestRunner.php:349
0.0477 3613296 6. PHPUnit_Framework_TestSuite->runTest() /home/pierreyves/projects/symfony2/symfony/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php:745
0.0477 3613296 7. PHPUnit_Framework_TestCase->run() /home/pierreyves/projects/symfony2/symfony/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php:775
0.0477 3613296 8. PHPUnit_Framework_TestResult->run() /home/pierreyves/projects/symfony2/symfony/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php:776
0.0478 3614208 9. PHPUnit_Framework_TestCase->runBare() /home/pierreyves/projects/symfony2/symfony/vendor/phpunit/phpunit/PHPUnit/Framework/TestResult.php:648
0.0478 3630992 10. PHPUnit_Framework_TestCase->runTest() /home/pierreyves/projects/symfony2/symfony/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php:831
0.0478 3631856 11. ReflectionMethod->invokeArgs() /home/pierreyves/projects/symfony2/symfony/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php:976
0.0478 3631888 12. Symfony\Component\DomCrawler\Tests\FormTest->testSetValueOnMultiValuedFieldsWithMalformedName() /home/pierreyves/projects/symfony2/symfony/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php:976
0.0481 3635560 13. Symfony\Component\DomCrawler\Form->offsetSet() /home/pierreyves/projects/symfony2/symfony/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php:255
0.0481 3635560 14. Symfony\Component\DomCrawler\FormFieldRegistry->set() /home/pierreyves/projects/symfony2/symfony/src/Symfony/Component/DomCrawler/Form.php:320
```
In this case, `FormFieldRegistry::getSegments('foo[bar')` method is called and it will return `array('foo')` only. Therefore the return of `FormFieldRegistry::get('foo[bar')` returns an array instead of a `FormField` and so the `setValue()` call happen on the array which leads to the fatal error.
I tried to fix that. I don't know if it's the best way to do this so, as always, comments are welcome.
Commits
-------
bce6bd2 [DomCrawler] Fixed a fatal error when setting a value in a malformed field name.
This PR was merged into the 2.2 branch.
Discussion
----------
[HttpKernel] instantiate valid commands only
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | debatable ..
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
This skips the default behavior to instantiate `Command` that cannot simply be instantiated. The respective commands have to be registered by other means.
Commits
-------
afad9c7 instantiate valid commands only
This PR was submitted for the 2.2 branch but it was merged into the 2.1 branch instead (closes#8183).
Discussion
----------
Fixed exit code for exceptions with error code 0
Covers https://github.com/symfony/symfony/issues/8180
Commits
-------
48e77f8 Fixed exit code for exceptions with error code 0