Commit Graph

21624 Commits

Author SHA1 Message Date
Nicolas Grekas
6e1ae53fea Minor fixes 2015-06-30 18:05:31 +02:00
Fabien Potencier
0020680d92 bug #15146 Towards 100% HHVM compat (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

Towards 100% HHVM compat

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

Failing components:
- [x] Debug
- [x] DependencyInjection
- [x] Filesystem
- [x] Form
- [x] HttpFoundation
- [x] Process
- [x] Routing

Related HHVM issues:
- https://github.com/facebook/hhvm/issues/5562
- https://github.com/facebook/hhvm/issues/5561
- https://github.com/facebook/hhvm/issues/5330
- https://github.com/facebook/hhvm/issues/3558
- https://github.com/facebook/hhvm/issues/4901

Commits
-------

b9a76ba Towards 100% HHVM compat
2015-06-30 17:31:35 +02:00
Nicolas Grekas
b9a76bab5c Towards 100% HHVM compat 2015-06-30 15:39:12 +02:00
Fabien Potencier
b16fc6c2f6 bug #15061 [Form] Fixed handling of choices passed in choice groups (webmozart)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] Fixed handling of choices passed in choice groups

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

I introduced a bug in the 2.7 ChoiceList implementation when choices are passed as groups:

```
$form->add('response', 'choice', array(
    'choices' => array(
        'Decided' => array($yesObj, $noObj),
        'Undecided' => array($maybeObj),
    ),
    // use getName() for the labels
    'choice_label' => 'name',
    'choices_as_values' => true,
));
```

In this example, since the choices `$yesObj` and `$maybeObj` have the same array index `0`, the same label is displayed for the two options. The problem is that we rely on the keys passed in the "choices" option to identify choices in a choice list (which are, as you see, not guaranteed to be free of duplicates).

This PR changes the new choice list implementation to identify choices by values instead. We already have the guarantee that choices can be identified uniquely by their string values.

This PR should be included in 2.7.2 to fix the regression.

Unfortunately, a few BC breaks in the new implementation are necessary to make this fix:

* The legacy `ChoiceListInterface` was reverted to how it was in 2.6 and does *not* extend the new `ChoiceListInterface` anymore.
* As a consequence, legacy choice lists need to be wrapped into a `LegacyChoiceListAdapter` when they are passed to any place in the framework where a new choice list is expected.
* The new `ChoiceListInterface` has two additional methods `getStructuredValues()` and `getOriginalKeys()` now.
* `ArrayKeyChoiceList::toArrayKey()` was marked as internal.
* `ChoiceListFactoryInterface::createView()` does not accept arrays and Traversables anymore for the `$groupBy` parameter (for simplicity).

@fabpot Where should we document the upgrade path for 2.7.1 => 2.7.2?

Commits
-------

7623dc8 [Form] Fixed handling of choices passed in choice groups
2015-06-30 14:46:52 +02:00
Fabien Potencier
bfc174a178 bug #15145 [Bridge/PhpUnit] Enforce a consistent locale (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[Bridge/PhpUnit] Enforce a consistent locale

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

Will fix some HHVM failures

Commits
-------

b04fe83 [Bridge/PhpUnit] Enforce a consistent locale
2015-06-30 11:32:10 +02:00
Nicolas Grekas
b04fe832ac [Bridge/PhpUnit] Enforce a consistent locale 2015-06-30 10:16:45 +02:00
Fabien Potencier
38c08d1fb3 bug #15069 [Form] Fixed: Data mappers always receive forms indexed by their names (webmozart)
This PR was merged into the 2.3 branch.

Discussion
----------

[Form] Fixed: Data mappers always receive forms indexed by their names

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

This PR facilitates writing domain-specific data mappers, since it guarantees that you can access forms by name in the data mapper methods. Currently, `Form::add()` does not set the index of the array passed to the data mapper to the form's name.

Commits
-------

86b7fe5 [Form] Fixed: Data mappers always receive forms indexed by their names
2015-06-30 07:54:26 +02:00
Fabien Potencier
f28ee56b67 bug #15137 [Security] Initialize SwitchUserEvent::targetUser on attemptExitUser (Rvanlaak, xabbuh)
This PR was merged into the 2.3 branch.

Discussion
----------

[Security] Initialize SwitchUserEvent::targetUser on attemptExitUser

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

Commits
-------

f999217 trigger event with right user (add test)
01ee3f6 [Security] Initialize SwitchUserEvent::targetUser on attemptExitUser
2015-06-30 07:51:24 +02:00
Fabien Potencier
c20720f9f6 bug #15142 Fix choice translation domain for expanded choice widget (jvasseur)
This PR was merged into the 2.7 branch.

Discussion
----------

Fix choice translation domain for expanded choice widget

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

This fix the form component using the translation_domain instead of the choice_translation_domain for expanded choice widgets.

I had to add the possibility to skip label translation when using ```translation_domain => false``` to do this fix so this can be considered a new feature to.

Commits
-------

52755ba Fix choice translation domain for expanded choice widget
2015-06-30 07:47:57 +02:00
Fabien Potencier
148c7db74e minor #15143 unify default AccessDeniedExeption message (xabbuh)
This PR was merged into the 2.6 branch.

Discussion
----------

unify default AccessDeniedExeption message

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

Commits
-------

87e7709 unify default AccessDeniedExeption message
2015-06-30 07:44:03 +02:00
Tobias Schultze
c8e999b198 minor #15144 [Finder] Fix PHPUnit param order (Dave Hulbert)
This PR was merged into the 2.7 branch.

Discussion
----------

[Finder] Fix PHPUnit param order

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

Fairly cosmetic but it confused me for a while when I broke tests and PHPUnit said something like

    --- Expected
    +++ Actual
    @@ @@
    -'/^(?=[^\.])x\.[^/]*$/'
    +'/^\.[^/]*$/'

Looks like 2.7 is the earliest this can be merged into.

Commits
-------

8e41a5b Fix param order of assertEquals (expected, actual) in test for Finder\Glob
2015-06-30 00:30:04 +02:00
Dave Hulbert
8e41a5b22a Fix param order of assertEquals (expected, actual) in test for Finder\Glob 2015-06-29 20:56:37 +01:00
Jérôme Vasseur
52755ba26d Fix choice translation domain for expanded choice widget 2015-06-29 21:23:41 +02:00
Christian Flothmann
87e7709b7b unify default AccessDeniedExeption message 2015-06-29 20:24:24 +02:00
Christian Flothmann
f999217a96 trigger event with right user (add test) 2015-06-28 20:33:21 +02:00
Richard van Laak
01ee3f6cda [Security] Initialize SwitchUserEvent::targetUser on attemptExitUser
The `SwitchUserEvent` is triggered in case an account is switched. This works okay while switching to the user, but on exit the `SwitchUserEvent` is triggered again with the original User. That User was not initialized by the provider yet.

load user by UserInterface instead of username
2015-06-28 20:33:21 +02:00
Fabien Potencier
b6dbfa4b73 minor #15136 Fix quoting style consistency (2.7) (ogizanagi)
This PR was merged into the 2.7 branch.

Discussion
----------

Fix quoting style consistency (2.7)

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

Follows up #15129.

Commits
-------

2aab007 Fix quoting style consistency.
2015-06-28 19:27:31 +02:00
Fabien Potencier
873e3d9a74 Merge branch '2.6' into 2.7
* 2.6:
  [2.6][Validator] Fix BC for Validator's validate method
  Very small typo fix
  Fix quoting style consistency.
  [DependencyInjection] Fail when dumping a Definition with no class nor factory
  Normalizing recursively - see #9096
  No change - the normalizeParams is a copy-and-paste of the earlier logic
  fixes issue with logging array of non-utf8 data
  fix validation for Maestro UK card numbers

Conflicts:
	src/Symfony/Component/Security/Http/Firewall/DigestAuthenticationListener.php
	src/Symfony/Component/Validator/Validator/LegacyValidator.php
2015-06-28 19:13:14 +02:00
Fabien Potencier
e36e83117b Merge branch '2.3' into 2.6
* 2.3:
  Fix quoting style consistency.
  [DependencyInjection] Fail when dumping a Definition with no class nor factory
  Normalizing recursively - see #9096
  No change - the normalizeParams is a copy-and-paste of the earlier logic
  fixes issue with logging array of non-utf8 data
  fix validation for Maestro UK card numbers
2015-06-28 19:11:14 +02:00
Fabien Potencier
6e4563e7ee bug #15126 [2.6][Validator] Fix BC for Validator's validate method (michalmarcinkowski)
This PR was merged into the 2.6 branch.

Discussion
----------

[2.6][Validator] Fix BC for Validator's validate method

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

This fix makes method call ``` $validator->validate($value, array()); ``` backward compatible and does not throw

```
[Symfony\Component\Validator\Exception\NoSuchMetadataException]

The class or interface "XXX" does not exist.
```

when the ``` $value ``` is a scalar type.

Commits
-------

ffe25dc [2.6][Validator] Fix BC for Validator's validate method
2015-06-28 19:09:43 +02:00
Fabien Potencier
7e418fd954 minor #15129 Fix quoting style consistency. (ogizanagi)
This PR was merged into the 2.3 branch.

Discussion
----------

Fix quoting style consistency.

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

This is a really minor change with reference to [this comment](https://github.com/symfony/symfony/pull/15002#discussion_r32536303).

If it's fine, [those changes](https://github.com/symfony/symfony/compare/symfony:2.7...ogizanagi:fix_quoting_style/2.7) for 2.7 will follow up too.

Commits
-------

57d30f9 Fix quoting style consistency.
2015-06-28 19:07:35 +02:00
Fabien Potencier
cf6296b3db bug #15101 [Form] Fixed compatibility with FormTypeInterface implementations that don't extend AbstractType (webmozart)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] Fixed compatibility with FormTypeInterface implementations that don't extend AbstractType

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

Commits
-------

4a1ad7e [Form] Fixed compatibility with FormTypeInterface implementations that don't extend AbstractType
2015-06-28 19:06:19 +02:00
Fabien Potencier
26af381433 minor #15132 Very small typo fix (WouterJ)
This PR was merged into the 2.6 branch.

Discussion
----------

Very small typo fix

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

Commits
-------

04deaed Very small typo fix
2015-06-28 19:05:51 +02:00
michalmarcinkowski
ffe25dc921 [2.6][Validator] Fix BC for Validator's validate method 2015-06-28 16:52:59 +02:00
Wouter J
04deaed544 Very small typo fix 2015-06-28 16:17:58 +02:00
ogizanagi
2aab0073bd Fix quoting style consistency. 2015-06-28 12:39:54 +02:00
ogizanagi
57d30f9746 Fix quoting style consistency. 2015-06-28 12:13:08 +02:00
Fabien Potencier
e93a3d7896 bug #15083 [DependencyInjection] Fail when dumping a Definition with no class nor factory (nicolas-grekas)
This PR was merged into the 2.3 branch.

Discussion
----------

[DependencyInjection] Fail when dumping a Definition with no class nor factory

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

I tried creating an anonymous inline service with a DefinitionDecorator, but that did not work.
Here is the fix.

Commits
-------

23ad4ad [DependencyInjection] Fail when dumping a Definition with no class nor factory
2015-06-28 09:25:22 +02:00
Nicolas Grekas
23ad4ad133 [DependencyInjection] Fail when dumping a Definition with no class nor factory 2015-06-28 09:23:14 +02:00
Fabien Potencier
77da994658 bug #15127 [Validator] fix validation for Maestro UK card numbers (xabbuh)
This PR was merged into the 2.3 branch.

Discussion
----------

[Validator] fix validation for Maestro UK card numbers

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

The issue with the fix in #15086 was, that the `[56-69]` part of the regular expression did not cover the numbers from 56 to 69 but only matched one number if it was 5, 6 or 9 which means that the regular expression itself was not only invalid, but also covered only a total maximum length of 18 digits.

Commits
-------

f24532a fix validation for Maestro UK card numbers
2015-06-28 09:11:08 +02:00
Fabien Potencier
0cd30622d3 bug #15128 DbalLogger: Small nonutf8 array fix (vpetrovych, weaverryan)
This PR was merged into the 2.3 branch.

Discussion
----------

DbalLogger: Small nonutf8 array fix

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

Hi guys!

Just a small triage of #9096. Actually, @vpetrovych did all the work, and I was able to rebase and keep his original commit for authorship :).

This is obviously a very minor, edge issue - but the patch is simple. The new `normalizeParams` function is an exact copy-and-paste except for the changes in sha: 1882a2ae47

Thanks!

Commits
-------

1882a2a Normalizing recursively - see #9096
8edd4c6 No change - the normalizeParams is a copy-and-paste of the earlier logic
eae907c fixes issue with logging array of non-utf8 data
2015-06-28 09:09:31 +02:00
Ryan Weaver
1882a2ae47 Normalizing recursively - see #9096 2015-06-27 18:20:43 -04:00
Ryan Weaver
8edd4c6ffb No change - the normalizeParams is a copy-and-paste of the earlier logic 2015-06-27 18:19:06 -04:00
Vladyslav Petrovych
eae907c4ed fixes issue with logging array of non-utf8 data 2015-06-27 18:14:41 -04:00
Christian Flothmann
f24532a04e fix validation for Maestro UK card numbers 2015-06-27 23:20:18 +02:00
Tobias Schultze
dd504d4adf Merge branch '2.6' into 2.7 2015-06-27 22:17:00 +02:00
Tobias Schultze
cbca187a49 Merge branch '2.3' into 2.6
Conflicts:
	src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig
	src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_collapsed.html.php
2015-06-27 22:15:38 +02:00
Tobias Schultze
d270bdc952 bug #15048 [Translation][Form][choice] empty_value shouldn't be translated when it has an empty value (Restless-ET)
This PR was squashed before being merged into the 2.3 branch (closes #15048).

Discussion
----------

[Translation][Form][choice] empty_value shouldn't be translated when it has an empty value

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

The same fix provided at #14997 but against ```2.3``` branch.

@webmozart As requested. :)

Commits
-------

1a5c4c6 [Translation][Form][choice] empty_value shouldn't be translated when it has an empty value
2015-06-27 19:53:03 +02:00
Restless-ET
1a5c4c6c93 [Translation][Form][choice] empty_value shouldn't be translated when it has an empty value 2015-06-27 19:52:55 +02:00
Fabien Potencier
921ea1ad4c minor #14935 [Validator][callback constraint] include class name in ConstraintDefinitionException. (aitboudad)
This PR was submitted for the 2.8 branch but it was merged into the 2.7 branch instead (closes #14935).

Discussion
----------

[Validator][callback constraint] include class name in ConstraintDefinitionException.

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

Commits
-------

51212ac [Validator][callback constraint] include class name in ConstraintDefinitionException.
2015-06-27 16:22:08 +02:00
Abdellatif Ait boudad
51212acbff [Validator][callback constraint] include class name in ConstraintDefinitionException. 2015-06-27 16:22:07 +02:00
Fabien Potencier
3ef7a1f6d6 bug #15117 [Form] fixed sending non array data on submit to ResizeListener (BruceWouaigne)
This PR was merged into the 2.3 branch.

Discussion
----------

[Form] fixed sending non array data on submit to ResizeListener

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

I agree with @Tobion that #13851 is a bug fix and therefore should be applied on the `2.3` branch too.

Commits
-------

0f185c9 [Form] [EventListener] fixed sending non array data on submit to ResizeListener
2015-06-27 16:14:07 +02:00
Fabien Potencier
f5d5a3be96 bug #15122 [Console] respect multi-character shortcuts (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Console] respect multi-character shortcuts

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

The `TextDescriptor` assumed that shortcuts will only consume one space
when calculating the maximum width needed to display the option's
synopsis.

Commits
-------

bd49f23 [Console] respect multi-character shortcuts
2015-06-27 16:10:25 +02:00
Fabien Potencier
30b2fd2e8b minor #15116 [FrameworkBundle] update type hint in test (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] update type hint in test

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

Commits
-------

96a5653 update type hint
2015-06-27 16:07:54 +02:00
Fabien Potencier
bccfb44171 minor #15112 [2.7][DependencyInjection] improve deprecation messages (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[2.7][DependencyInjection] improve deprecation messages

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

Also include the service id in the deprecation message.

Commits
-------

9e41fa7 [DependencyInjection] improve deprecation messages
2015-06-27 16:06:41 +02:00
Fabien Potencier
7d6d4319a6 bug #15012 [Validator] don't trigger deprecation with empty group array (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Validator] don't trigger deprecation with empty group array

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

Commits
-------

62f12cd [Validator] don't trigger deprecation with empty group array
2015-06-27 16:01:14 +02:00
Christian Flothmann
bd49f23bb1 [Console] respect multi-character shortcuts
The `TextDescriptor` assumed that shortcuts will only consume one space
when calculating the maximum width needed to display the option's
synopsis.
2015-06-26 23:20:39 +02:00
Christian Flothmann
62f12cde7a [Validator] don't trigger deprecation with empty group array 2015-06-26 23:10:48 +02:00
Fabien Potencier
06b8e0a068 minor #15107 Fix typo in Italian translation (garak)
This PR was submitted for the 2.8 branch but it was merged into the 2.3 branch instead (closes #15107).

Discussion
----------

Fix typo in Italian translation

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

Commits
-------

26c4413 Fix typo in Italian translation
2015-06-26 20:04:19 +02:00
Massimiliano Arione
26c4413f29 Fix typo in Italian translation 2015-06-26 20:04:19 +02:00