Commit Graph

23236 Commits

Author SHA1 Message Date
Jules Pietri 3eac4693ad [Form] fix choice value "false" in ChoiceType 2016-02-22 16:33:26 +01:00
Fabien Potencier 9124c28b10 minor #17872 [CS] PHPUnit dedicate assert fixer acceptance test (SpacePossum)
This PR was merged into the 2.3 branch.

Discussion
----------

[CS] PHPUnit dedicate assert fixer acceptance test

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | no
| License       | MIT

The goal of this PR is _not_ to have it merge, but to check with SF community if a new Fixer (https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/1792) should be added to the set of Symfony fixers (at PHP-CS-Fixer).

Commits
-------

7aff7f4 PhpUnitNoDedicateAssertFixer results
2016-02-22 16:29:01 +01:00
Fabien Potencier 24cdae71a1 minor #17883 Update twig.html.twig (tvlooy)
This PR was merged into the 2.7 branch.

Discussion
----------

Update twig.html.twig

| Q             | A
| ------------- | ---
| Bug fix?      | [no]
| New feature?  | [yes]
| BC breaks?    | [no]
| Deprecations? | [no]
| Tests pass?   | [yes]
| Fixed tickets |
| License       | MIT
| Doc PR        |

Replace base64 template icon with svg version. If you set the Content-Security-Policy you would need to provide "img-src 'self' data:;" just for that icon (or get an error in the console). This should be fixed in the new version of the toolbar but it would be nice to have a fix for 2.7 LTS too.

Commits
-------

d29f04c Update twig.html.twig
2016-02-22 16:01:50 +01:00
Fabien Potencier 98a946a481 minor #17859 [2.7] [FrameworkBundle] minor fix tests added by #17569 (HeahDude)
This PR was merged into the 2.7 branch.

Discussion
----------

[2.7] [FrameworkBundle] minor fix tests added by #17569

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | -

Commits
-------

ce6e5ac [2.7] [FrameworkBundle] minor fix tests added by #17569
2016-02-22 15:50:41 +01:00
Tom Van Looy d29f04c149 Update twig.html.twig
Replace base64 template icon with svg version. If you set the Content-Security-Policy you would need to provide "img-src 'self' data:;" just for that icon (or get an error in the console). This should be fixed in the new version of the toolbar but it would be nice to have a fix for 2.7 LTS too.
2016-02-22 14:30:57 +01:00
Benoît Burnichon aaad5bd3d1 Add check on If-Range header
Also verify edge case where no last-modified header is available
2016-02-22 12:57:02 +01:00
SpacePossum 7aff7f42c1 PhpUnitNoDedicateAssertFixer results 2016-02-21 12:34:19 +01:00
Christian Flothmann 56f87982d8 replace alias in factory services 2016-02-20 20:14:11 +01:00
Fabien Potencier d8ad5a2cd4 minor #17862 Improve Norwegian translations (valisj)
This PR was submitted for the 2.8 branch but it was merged into the 2.3 branch instead (closes #17862).

Discussion
----------

Improve Norwegian translations

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | N/A
| License       | MIT

This PR (1) fixes multiple grammatical errors in the Norwegian translations and (2) adds missing translations.

Commits
-------

73a5d6c Improve Norwegian translations
2016-02-20 17:42:17 +01:00
Valentin Jonovs 73a5d6c684 Improve Norwegian translations 2016-02-20 17:42:01 +01:00
Christian Flothmann 66fb0bd43d minor #17855 Simplify markdown for PR template (Pierstoval)
This PR was merged into the 2.3 branch.

Discussion
----------

Simplify markdown for PR template

I know it's all about rendering in the issue, but actually putting `[` in markdown can create some issues.

Here, having raw informations looks better IMO and does not cause any rendering issue when not used. And double-click-selection does not force to remove the brackets manually.

What do you think?

Commits
-------

a278035 Simplify markdown for PR template
2016-02-19 22:51:09 +01:00
Jules Pietri ce6e5ac5aa [2.7] [FrameworkBundle] minor fix tests added by #17569 2016-02-19 17:41:56 +01:00
Alex Rock Ancelet a2780357ca Simplify markdown for PR template 2016-02-19 16:05:47 +01:00
Fabien Potencier 653428af76 Merge branch '2.3' into 2.7
* 2.3:
  fixed CS
  fixed CS
  documented the $url parameter better
  register commands from kernel when accessing list
  Update FileSystem
2016-02-18 17:03:55 +01:00
Fabien Potencier a02967c9ee fixed CS 2016-02-18 16:45:01 +01:00
Fabien Potencier e932baec28 bug #17569 [FrameworkBundle] read commands from bundles when accessing list (havvg)
This PR was merged into the 2.3 branch.

Discussion
----------

[FrameworkBundle] read commands from bundles when accessing list

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

This allows access to the list of commands registered by the kernel (bundle and later service ids) programmatically when you do not `run` the application.

Commits
-------

0fe3088 register commands from kernel when accessing list
2016-02-18 16:42:34 +01:00
Fabien Potencier 1f22290d8c fixed CS 2016-02-18 16:12:50 +01:00
Fabien Potencier 7ce861d09a bug #16987 [FileSystem] Windows fix (flip111)
This PR was merged into the 2.3 branch.

Discussion
----------

[FileSystem] Windows fix

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/16783
| License       | MIT
| Doc PR        |

* Fixes edge case on windows where PHP does not generate a PHP Warning but instead returns a wrong result https://bugs.php.net/bug.php?id=71103
* Improved error reporting on `unlink` used in `remove()`

Commits
-------

0d5f7e2 Update FileSystem
2016-02-18 16:09:31 +01:00
Fabien Potencier 59944896f2 documented the $url parameter better 2016-02-18 14:55:48 +01:00
Fabien Potencier 6cc7e2efae minor #17832 [Form] add test for ArrayChoiceList handling null (Tobion)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] add test for ArrayChoiceList handling null

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

I found this bug but then realised that it was already fixed in #17511.
So this just adds a test.

Commits
-------

00e3819 [Form] add test for ArrayChoiceList handling null
2016-02-18 14:35:50 +01:00
Tobias Schultze 00e38198b7 [Form] add test for ArrayChoiceList handling null 2016-02-18 14:16:01 +01:00
Fabien Potencier d3c55cb3f1 bug #17787 [Form] Fix choice placeholder edge cases (Tobion)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] Fix choice placeholder edge cases

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Fixing several problems with choice placeholder that enhances #9030 for more edge cases:

- A choice with an empty value manually added in the choices array should only be considered a placeholder when it is the first element in the final choice select.
This is part of the HTML spec and how browsers also behave. If you select a choice with an empty value that is not the first option, it will still pass the "required" check
and thus submit the empty value. So it's not a placeholder.
If in the example below you move the empty option to the first place, the browsers will error on submit that you
must select a value. So only then it is a placeholder to show as initial value.

```html
<select id="form_timezone" name="form[timezone]" required="required">
    <option value="Africa/Abidjan">Abidjan</option>
    <option value="">Empty</option>
</select>
```

Also the validator https://validator.w3.org/nu/ will mark the above code as error:
> The first child option element of a select element with a required attribute, and without a multiple attribute, and without a size attribute whose value is greater than 1, must have either an empty value attribute, or must have no text content. Consider either adding a placeholder option label, or adding a size attribute with a value equal to the number of option elements.

This is fixed by replacing`0 !== count($choiceList->getChoicesForValues(array('')))` with `$view->vars['placeholder_in_choices'] = $choiceListView->hasPlaceholder()`.
Which means, the required attribute is removed automatically because the select form element is required implicitly anyway due to the nature of the choice UI.

- As the above quote mentions, the `size` attribute also has impact. Namely for a select with size > 1 it can be possible to have a required attribute even without placeholder.
This is because when the size > 1, there is no default choice selected (similar to select with "multiple").

- A placeholder for required radio buttons or a select with size > 1 does not make sense as it would just be fake data that can be submitted (similar to the ignored placeholder for multi-select and checkboxes).

Commits
-------

0efbc30 [Form] fix edge cases with choice placeholder
2016-02-18 13:07:46 +01:00
Nicolas Grekas de5c737426 Merge branch '2.3' into 2.7
* 2.3:
  Create PULL_REQUEST_TEMPLATE.md
  Remove duplicate validation in RedirectResponse
  [Yaml] fix default timezone to be UTC
  [DependencyInjection] fix dumped YAML string

Conflicts:
	src/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php
	src/Symfony/Component/Yaml/Tests/InlineTest.php
2016-02-18 09:57:30 +01:00
Fabien Potencier 31d4548d78 minor #17827 [Config] Add suggest to composer.json for symfony/yaml (Calin Mihai Pristavu)
This PR was merged into the 2.7 branch.

Discussion
----------

[Config] Add suggest to composer.json for symfony/yaml

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #17826
| License       | MIT

Fixes #17826

Commits
-------

2200b0c [Config] Add suggest to composer.json for symfony/yaml
2016-02-18 08:23:36 +01:00
Fabien Potencier f676878fe0 minor #17831 Create PULL_REQUEST_TEMPLATE.md (colinodell)
This PR was squashed before being merged into the 2.3 branch (closes #17831).

Discussion
----------

Create PULL_REQUEST_TEMPLATE.md

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | n/a
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Github has support for issue and template files (`issue_template.md` and `pull_request_template.md`).  The contents of these files will auto-populate new issues/PRs.

This PR creates a `PULL_REQUEST_TEMPLATE.md` file using the [Symfony Pull Request Template](https://symfony.com/doc/current/contributing/code/patches.html#make-a-pull-request).

See https://github.com/blog/2111-issue-and-pull-request-templates

Commits
-------

ac8f8f8 Create PULL_REQUEST_TEMPLATE.md
2016-02-18 08:17:40 +01:00
Colin O'Dell ac8f8f8964 Create PULL_REQUEST_TEMPLATE.md 2016-02-18 08:17:38 +01:00
Fabien Potencier 5fda221d47 bug #17835 [Yaml] fix default timezone to be UTC (xabbuh)
This PR was merged into the 2.3 branch.

Discussion
----------

[Yaml] fix default timezone to be UTC

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

e9ee877 [Yaml] fix default timezone to be UTC
2016-02-18 08:04:48 +01:00
Fabien Potencier f01cda604c minor #17838 Remove duplicate validation in RedirectResponse (Tobion)
This PR was merged into the 2.3 branch.

Discussion
----------

Remove duplicate validation in RedirectResponse

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

d27c4f4 Remove duplicate validation in RedirectResponse
2016-02-18 08:03:40 +01:00
Tobias Schultze d27c4f4d68 Remove duplicate validation in RedirectResponse 2016-02-18 01:47:59 +01:00
Christian Flothmann e9ee877e4b [Yaml] fix default timezone to be UTC 2016-02-17 22:15:58 +01:00
Tobias Schultze d3114d1778 bug #17823 [DependencyInjection] fix dumped YAML string (xabbuh)
This PR was merged into the 2.3 branch.

Discussion
----------

[DependencyInjection] fix dumped YAML string

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

b1bb135 [DependencyInjection] fix dumped YAML string
2016-02-17 22:06:18 +01:00
Christian Flothmann b1bb135249 [DependencyInjection] fix dumped YAML string 2016-02-17 17:36:45 +01:00
Calin Mihai Pristavu 2200b0c178 [Config] Add suggest to composer.json for symfony/yaml 2016-02-17 16:19:09 +02:00
Fabien Potencier fd33367074 minor #17820 [Form] fix violation mapper tests (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] fix violation mapper tests

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #17099
| License       | MIT
| Doc PR        |

This takes into account the changes to the `getErrors()` in Symfony 2.5
(the method rturns a `FormErrorIterator` instead of an array) as well as
the fact that non-submitted forms do not accept errors since #10567
anymore.

Commits
-------

f87558d [Form] fix violation mapper tests
2016-02-17 07:13:55 +01:00
Fabien Potencier 2c59be51df bug #17818 [Console] InvalidArgumentException is thrown under wrong condition (robinkanters)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #17818).

Discussion
----------

[Console] InvalidArgumentException is thrown under wrong condition

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | N/A
| License       | MIT
| Doc PR        | no

When an object is passed to `setAutocompleterValues` that implements `\Countable` and `\Traversable`, an `InvalidArgumentException` is thrown, even though its message says that the argument should implement both of those interfaces.

Instead, the exception should be thrown if the parameter fails to implement either `\Countable` or `\Traversable`, like the exception message says.

_Disclaimer: I've been looking at this line for 10min, and I've become convinced it should be changed according to my PR, but I could be wrong._

Commits
-------

8eea65e The exception should be thrown if an object doesn't implement Traversable AND doesn't implement Countable, not when it doesn't implement Traversable but DOES implement Countable
2016-02-17 07:13:05 +01:00
Robin Kanters 8eea65e0d8 The exception should be thrown if an object doesn't implement Traversable AND doesn't implement Countable, not when it doesn't implement Traversable but DOES implement Countable 2016-02-17 07:12:58 +01:00
Fabien Potencier a515383611 bug #17819 [HttpKernel] Prevent a fatal error when DebugHandlersListener is used with a kernel with no terminateWithException() method (jakzal)
This PR was merged into the 2.7 branch.

Discussion
----------

[HttpKernel] Prevent a fatal error when DebugHandlersListener is used with a kernel with no terminateWithException() method

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

I just suffered from this bug on a project that used HttpKernelInterface implementation with no `terminateWithException() method (which is not part of the interface).

Commits
-------

2849152 [HttpKernel] Prevent a fatal error when DebugHandlersListener is used with a kernel with no terminateWithException() method
2016-02-17 07:06:50 +01:00
Christian Flothmann f87558d05e [Form] fix violation mapper tests
This takes into account the changes to the `getErrors()` in Symfony 2.5
(the method rturns a `FormErrorIterator` instead of an array) as well as
the fact that non-submitted forms do not accept errors since #10567
anymore.
2016-02-16 20:52:17 +01:00
Jakub Zalas 2849152c5e [HttpKernel] Prevent a fatal error when DebugHandlersListener is used with a kernel with no terminateWithException() method 2016-02-16 16:51:17 +00:00
Christian Flothmann 1c79c7b234 Merge branch '2.3' into 2.7
* 2.3:
  don't rely on deprecated YAML parser feature
2016-02-16 10:30:21 +01:00
Christian Flothmann 1dcf83c35b minor #17816 [DependencyInjection] don't rely on deprecated YAML parser feature (xabbuh)
This PR was merged into the 2.3 branch.

Discussion
----------

[DependencyInjection] don't rely on deprecated YAML parser feature

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #17814
| License       | MIT
| Doc PR        |

see [failing tests for the 2.7 branch](https://travis-ci.org/symfony/symfony/jobs/109537695#L2238)

Commits
-------

c8d387f don't rely on deprecated YAML parser feature
2016-02-16 10:29:38 +01:00
Christian Flothmann c8d387f131 don't rely on deprecated YAML parser feature 2016-02-16 09:57:10 +01:00
Fabien Potencier 1af6e98851 Merge branch '2.3' into 2.7
* 2.3:
  fix YAML syntax in functional tests config
2016-02-16 08:15:42 +01:00
Fabien Potencier 9b093c9744 minor #17810 fix YAML syntax in functional tests config (xabbuh)
This PR was merged into the 2.3 branch.

Discussion
----------

fix YAML syntax in functional tests config

| Q             | A
| ------------- | ---
| Fixed tickets |
| License       | MIT

see failing tests in #17809

Commits
-------

d9af4bc fix YAML syntax in functional tests config
2016-02-16 08:14:17 +01:00
Fabien Potencier a6e934c0ca minor #17811 [FrameworkBundle] fix YAML syntax (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] fix YAML syntax

| Q             | A
| ------------- | ---
| Fixed tickets |
| License       | MIT

see failing tests in #17809

Commits
-------

2da4038 [FrameworkBundle] fix YAML syntax
2016-02-16 08:13:32 +01:00
Fabien Potencier 457967c6c7 Merge branch '2.3' into 2.7
* 2.3:
  [DependencyInjection] fix dumped YAML snytax
  Remove InputOption::VALUE_REQUIRED mode from $default parameter description as InputOption::setDefault() throws an exception only when called in InputOption::VALUE_NONE mode. In practice the $default value could still be accessed in InputOption::VALUE_REQUIRED mode in case InputOption was never set but accessed from InputDefinition::getOption() method
  [Form] Fixed violation mapping if multiple forms are using the same (or part of the same) property path
  [TwigBridge] Symfony 3.1 forward compatibility
2016-02-16 07:07:10 +01:00
Fabien Potencier 3f749d6559 bug #17814 [DependencyInjection] fix dumped YAML snytax (xabbuh)
This PR was merged into the 2.3 branch.

Discussion
----------

[DependencyInjection] fix dumped YAML snytax

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

see the failing tests in #17809

Commits
-------

30388f1 [DependencyInjection] fix dumped YAML snytax
2016-02-16 07:02:27 +01:00
Christian Flothmann 30388f17ff [DependencyInjection] fix dumped YAML snytax 2016-02-15 22:04:15 +01:00
Fabien Potencier f6e401a973 minor #17707 Remove InputOption::VALUE_REQUIRED mode from $default parameter description (tomasliubinas)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #17707).

Discussion
----------

Remove InputOption::VALUE_REQUIRED mode from $default parameter description

Reopening previous PR, providing more information

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Remove InputOption::VALUE_REQUIRED mode from $default parameter description as InputOption::setDefault() throws an exception only when called with InputOption::VALUE_NONE mode.
In practice the $default not null value could be still used in VALUE_REQUIRED mode in case InputOption was never set but accessed from InputDefinition::getOption() method.

There is an important difference between 2 concepts. Not required Option AND not required option Value. When the not required Option is not provided the default value still could be taken from required option Value instance.

Relevant (correct) test case:
https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Console/Tests/Input/InputOptionTest.php#L136

Commits
-------

3c06151 Remove InputOption::VALUE_REQUIRED mode from $default parameter description as InputOption::setDefault() throws an exception only when called in InputOption::VALUE_NONE mode. In practice the $default value could still be accessed in InputOption::VALUE_REQUIRED mode in case InputOption was never set but accessed from InputDefinition::getOption() method
2016-02-15 20:17:39 +01:00
Tomas Liubinas 3c0615141e Remove InputOption::VALUE_REQUIRED mode from $default parameter description as InputOption::setDefault() throws an exception only when called in InputOption::VALUE_NONE mode.
In practice the $default value could still be accessed in InputOption::VALUE_REQUIRED mode in case InputOption was never set but accessed from InputDefinition::getOption() method
2016-02-15 20:17:39 +01:00