Commit Graph

25659 Commits

Author SHA1 Message Date
Fabien Potencier
997e6d7a0b Merge branch '2.7' into 2.8
* 2.7:
  [TwigBundle] added missing dependencies for tests
  fixed CS
  Fix #19943 Make sure to process each interface metadata only once
2016-10-01 07:18:53 -07:00
Fabien Potencier
470dc3e36f [TwigBundle] added missing dependencies for tests 2016-10-01 07:16:30 -07:00
Fabien Potencier
e20cd8ae9f fixed CS 2016-09-30 12:35:09 -07:00
Fabien Potencier
c1c42a52bc bug #20078 Fix #19943 Make sure to process each interface metadata only once (lemoinem)
This PR was merged into the 2.7 branch.

Discussion
----------

Fix #19943 Make sure to process each interface metadata only once

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

Here is the fix for #19943, If you have `InterfaceA <- InterfaceB <- Class` with a constraint on a method defined on `InterfaceA`, the constraint and its eventual violations are currently validated and reported twice.

Copy from https://github.com/symfony/symfony/issues/19943#issuecomment-250238529:
As far as I can see, the problem seems to arise in [`LazyLoadingMetadataFactory`](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Validator/Mapping/Factory/LazyLoadingMetadataFactory.php#L117-L123):

[`ReflectionClass::getInterfaces()`](http://php.net/manual/en/reflectionclass.getinterfaces.php) returns both interfaces implemented directly and through inheritance (either through another interface or through a parent class). In the end, the following process occurs:

1. `PriceInterface` is parsed and its `NotBlank` constraint on `value` is loaded
2. `VariablePriceInterface` is parsed and inherits `PriceInterface`'s constraints (which is OK).
3. `ProductPrice` is parsed and inherits both `PriceInterface` and `VariablePriceInterface`'s  constraints, which leads to a duplicated `NotBlank` constraint, one from each Interface.

The Best Way ™️ would be to be able to extract the list of interfaces implemented by a class directly only. However, the process seems a bit intricate... I will start working on it and prepare a PR to that effect. However, if any of you has a better idea, I'm all hears...

TODO:
- [x] Regression tests to make sure the bug doesn't reappear

Commits
-------

2f9b65a Fix #19943 Make sure to process each interface metadata only once
2016-09-30 12:33:15 -07:00
Fabien Potencier
2081bd9248 minor #20104 [TwigBundle] Adjust CacheWarmingTest for TemplateCacheWarmer introduced in 2.8 (tucksaun)
This PR was merged into the 2.8 branch.

Discussion
----------

[TwigBundle] Adjust CacheWarmingTest for TemplateCacheWarmer introduced in 2.8

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

With #20103, issue reported in #20065 is fixed, however it will now break in 2.8+ as another cache warmer has been introduced with #16271.

Commits
-------

360ca48 [TwigBundle] Adjust CacheWarmingTest for TemplateCacheWarmer introduced in 2.8
2016-09-30 07:47:16 -07:00
Tugdual Saunier
360ca48bdf
[TwigBundle] Adjust CacheWarmingTest for TemplateCacheWarmer introduced in 2.8 2016-09-30 15:27:26 +01:00
Fabien Potencier
fe4ae0befc Merge branch '2.7' into 2.8
* 2.7:
  [TwigBundle] Fix CacheWarmingTest are order dependent
  Revert "bug #20080 [Form] compound forms without children should be considered rendered implicitly (backbone87)"
  #17580 compound forms without children should be considered rendered implicitly
2016-09-30 07:22:20 -07:00
Fabien Potencier
d2c050ebe0 minor #20103 [TwigBundle] Fix CacheWarmingTest are order dependent (tucksaun)
This PR was merged into the 2.7 branch.

Discussion
----------

[TwigBundle] Fix CacheWarmingTest are order dependent

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

Fix issue reported in #20065

Commits
-------

fcd6ec2 [TwigBundle] Fix CacheWarmingTest are order dependent
2016-09-30 07:21:26 -07:00
Tugdual Saunier
fcd6ec2a5e
[TwigBundle] Fix CacheWarmingTest are order dependent 2016-09-30 14:26:39 +01:00
Fabien Potencier
35091b1837 Revert "bug #20080 [Form] compound forms without children should be considered rendered implicitly (backbone87)"
This reverts commit eae5a9ba0b, reversing
changes made to fd763ad5a3.
2016-09-29 16:48:55 -07:00
Fabien Potencier
eae5a9ba0b bug #20080 [Form] compound forms without children should be considered rendered implicitly (backbone87)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] compound forms without children should be considered rendered implicitly

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

Commits
-------

8234f2a #17580 compound forms without children should be considered rendered implicitly
2016-09-29 09:02:32 -07:00
Fabien Potencier
98548f9030 bug #20087 [2.8][VarDumper] Fix PHP 7.1 compat (nicolas-grekas)
This PR was merged into the 2.8 branch.

Discussion
----------

[2.8][VarDumper] Fix PHP 7.1 compat

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

Fix PHP 7.1 nullable support.

Commits
-------

1e84452 [2.8][VarDumper] Fix PHP 7.1 compat
2016-09-29 07:06:15 -07:00
Fabien Potencier
d6a9e3de38 Merge branch '2.7' into 2.8
* 2.7:
  [2.7][VarDumper] Fix PHP 7.1 compat
  silent file operation to avoid open basedir issues
2016-09-29 07:03:54 -07:00
Fabien Potencier
fd763ad5a3 bug #20086 [2.7][VarDumper] Fix PHP 7.1 compat (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[2.7][VarDumper] Fix PHP 7.1 compat

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

Fix PHP 7.1 nullable support.

Commits
-------

466dbe6 [2.7][VarDumper] Fix PHP 7.1 compat
2016-09-29 07:01:20 -07:00
Nicolas Grekas
466dbe62b4 [2.7][VarDumper] Fix PHP 7.1 compat 2016-09-29 13:21:39 +01:00
Nicolas Grekas
1e84452acb [2.8][VarDumper] Fix PHP 7.1 compat 2016-09-29 12:10:56 +01:00
Nicolas Grekas
536da69a49 minor #20085 [SecurityBundle] Fix Twig master dep (nicolas-grekas)
This PR was merged into the 2.8 branch.

Discussion
----------

[SecurityBundle] Fix Twig master dep

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

Since Twig 2 is not tagged yet, it's free to do not-BC changes, which it did recently. Our unmaintained `3.0.*` bridge+bundle don't work with it anymore. Let's skip them.

Commits
-------

9a2672e [SecurityBundle] Fix Twig master dep
2016-09-29 10:45:16 +01:00
Nicolas Grekas
9a2672e7fc [SecurityBundle] Fix Twig master dep 2016-09-29 10:23:02 +01:00
Fabien Potencier
07d4985024 bug #20077 [Process] silent file operation to avoid open basedir issues (xabbuh)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #20077).

Discussion
----------

[Process] silent file operation to avoid open basedir issues

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

Using file operations on a symlink that points to a file outside the directories being allowed by the open_basedir setting leads to PHP warnings being raised.

Commits
-------

30c9b1e silent file operation to avoid open basedir issues
2016-09-28 19:20:22 -07:00
Christian Flothmann
30c9b1ec28 silent file operation to avoid open basedir issues
Using file operations on a symlink that points to a file outside the
directories being allowed by the open_basedir setting leads to PHP
warnings being raised.
2016-09-28 19:20:21 -07:00
Fabien Potencier
28571d2cfb Merge branch '2.7' into 2.8
* 2.7:
  fixed Twig support for 1.26 and 2.0
2016-09-28 18:16:22 -07:00
Fabien Potencier
b4d5827b2c bug #20079 fixed Twig support for 1.26 and 2.0 (fabpot)
This PR was merged into the 2.7 branch.

Discussion
----------

fixed Twig support for 1.26 and 2.0

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

Removes the deprecation notices for Twig 1.26.

Commits
-------

24e9cf2 fixed Twig support for 1.26 and 2.0
2016-09-28 18:14:48 -07:00
Fabien Potencier
24e9cf2155 fixed Twig support for 1.26 and 2.0 2016-09-28 18:04:26 -07:00
Mathieu Lemoine
2f9b65aa5a Fix #19943 Make sure to process each interface metadata only once 2016-09-28 18:39:11 -04:00
Oliver Hoff
8234f2add4 #17580 compound forms without children should be considered rendered
implicitly
2016-09-28 21:40:37 +02:00
Fabien Potencier
6717f2c4e5 bug #20051 Fix indexBy type extraction (lemoinem)
This PR was merged into the 2.8 branch.

Discussion
----------

Fix indexBy type extraction

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

Bug found and patched by @ksom

Since 3008228b48, the Doctrine Bridge's PropertyInfo Extractor tries to extract the type of the key in an indexed association. However, as you can see in 3008228b48 (diff-7a8fb8072d57f95ea6e37898b05895bcR91), the extractor was using the metadata of the class containing the association instead of the target entity's metadata to retrieve the type of the index.

The tests were green because in 3008228b48 (diff-c7e914ed89ceffd939733efe08c039c2R44), the property used to `indexBy` was present in the classes on both sides of the relation with the same type.

Once the test is fixed (by renaming the property in the targetEntity), the test provided at 3008228b48 (diff-1b2e044d1df011c00caf802a07895bdbR88) gives the error

    1) Symfony\Bridge\Doctrine\PropertyInfo\Tests\DoctrineExtractorTest::testExtract with data set #9 ('indexedBar', array(Symfony\Component\PropertyInfo\Type Object (...)))
    InvalidArgumentException: "" is not a valid PHP type.

The fix is to fetch the metadata of the target entity and check there for the property type.

Commits
-------

138c6e3 Fix indexBy type extraction
2016-09-27 19:18:40 -07:00
Fabien Potencier
aef5008360 Merge branch '2.7' into 2.8
* 2.7:
  format json fixtures
  apply rtrim
2016-09-27 17:10:16 -07:00
Fabien Potencier
da6c664e98 minor #20064 [Console] Format JSON fixtures (ro0NL)
This PR was merged into the 2.7 branch.

Discussion
----------

[Console] Format JSON fixtures

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | comma-separated list of tickets fixed by the PR, if any
| License       | MIT
| Doc PR        | reference to the documentation PR, if any

Should make merging upstream easier due better diffs.

```php
foreach (glob('src/Symfony/Component/Console/Tests/Fixtures/*.json') as $file) {
    file_put_contents($file, str_replace(PHP_EOL, "\n", json_encode(json_decode(trim(file_get_contents($file))), JSON_PRETTY_PRINT))."\n");
}
```

Should be re-applied on 2.8, 3.1 and master.

Commits
-------

2ca7823 format json fixtures
2016-09-27 17:09:53 -07:00
Fabien Potencier
40c2cbd12b bug #19951 [Finder] Trim trailing directory slash in ExcludeDirectoryFilterIterator (ro0NL)
This PR was merged into the 2.7 branch.

Discussion
----------

[Finder] Trim trailing directory slash in ExcludeDirectoryFilterIterator

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #19599
| License       | MIT
| Doc PR        | reference to the documentation PR, if any

In this context `path` equals `path/`

Commits
-------

e0e5f0c apply rtrim
2016-09-27 17:07:53 -07:00
Roland Franssen
2ca78233a1 format json fixtures 2016-09-27 17:33:51 +00:00
Mathieu Lemoine
138c6e3752 Fix indexBy type extraction 2016-09-24 17:32:50 -04:00
Fabien Potencier
b049d098d3 Merge branch '2.7' into 2.8
* 2.7:
  Fixed expectedException annotations
  Security and validators messages translation to Latvian
  [Form] FormView->isRendered() remove dead code and simplify the flow
2016-09-24 08:56:40 -07:00
Fabien Potencier
732a363f21 minor #20043 @expectedException expects FQCN (ro0NL)
This PR was merged into the 2.8 branch.

Discussion
----------

@expectedException expects FQCN

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | comma-separated list of tickets fixed by the PR, if any
| License       | MIT
| Doc PR        | reference to the documentation PR, if any

See #20028

Almost there :)

Commits
-------

526b852 expectedException expects FQCN
2016-09-24 08:56:11 -07:00
Roland Franssen
526b852d2c expectedException expects FQCN 2016-09-24 09:47:20 +00:00
Fabien Potencier
e4f498aa82 minor #20028 Fixed expectedException annotations (ro0NL)
This PR was squashed before being merged into the 2.7 branch (closes #20028).

Discussion
----------

Fixed expectedException annotations

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | comma-separated list of tickets fixed by the PR, if any
| License       | MIT
| Doc PR        | reference to the documentation PR, if any

See #19237... as this is not going to be fixed in phpunit nor php-cs-fixer and i believe by now these are the last 2 false positives.

Found with `@expectedException\s+[^\s\\]`

In master there are still +-25 consistency issues, ie. FQCN but without a root namespace. Shall we fix this?

Commits
-------

b074a71 Fixed expectedException annotations
2016-09-23 11:13:38 -07:00
Roland Franssen
b074a7156a Fixed expectedException annotations 2016-09-23 11:13:36 -07:00
Fabien Potencier
fc0fe87c6d minor #20027 Security and validators messages translation to Latvian (Rikijs)
This PR was merged into the 2.7 branch.

Discussion
----------

Security and validators messages translation to Latvian

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

Commits
-------

ff72f21 Security and validators messages translation to Latvian
2016-09-22 09:52:50 -07:00
Rikijs Murgs
ff72f21427 Security and validators messages translation to Latvian 2016-09-22 19:04:04 +03:00
Fabien Potencier
8acf80f24d bug #20018 [VarDumper] Fix test (nicolas-grekas)
This PR was merged into the 2.8 branch.

Discussion
----------

[VarDumper] Fix test

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

Commits
-------

ae118e7 [VarDumper] Fix test
2016-09-21 13:53:02 -07:00
Nicolas Grekas
ae118e7885 [VarDumper] Fix test 2016-09-21 22:46:44 +02:00
Fabien Potencier
8e6342a90e minor #20016 [Form] FormView->isRendered() remove dead code and simplify the flow (taueres)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] FormView->isRendered() remove dead code and simplify the flow

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

The method `FormView->isRendered()` can be easily simplified by removing useless conditions and statements.
The condition at line 74 is useless because of the composite condition at line 70.
Removed dead code statement at line 84.

Commits
-------

40af42c [Form] FormView->isRendered() remove dead code and simplify the flow
2016-09-21 13:31:17 -07:00
Sergio Santoro
40af42cb60 [Form] FormView->isRendered() remove dead code and simplify the flow 2016-09-21 22:14:19 +02:00
Fabien Potencier
83d948be44 bug #20011 Use UUID for error codes for Form validator. (Koc)
This PR was merged into the 2.8 branch.

Discussion
----------

Use UUID for error codes for Form validator.

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | tiny, but it allowed http://symfony.com/doc/current/contributing/code/bc.html#changing-classes
| Deprecations? | no
| Tests pass?   | I hope so :)
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

3693e83 Use UUID for error codes for Form validator.
2016-09-21 12:04:33 -07:00
Fabien Potencier
456b09ce61 Merge branch '2.7' into 2.8
* 2.7:
  Revert "minor #20011 Use UUID for error codes for Form validator. (Koc)"
  Use UUID for error codes for Form validator.
  Fixed regression when exception message swallowed when logging it.
  [HttpFoundation] Enable memcached tests with the latest memcached extension
2016-09-21 12:04:07 -07:00
Fabien Potencier
bb51ed0d20 Revert "minor #20011 Use UUID for error codes for Form validator. (Koc)"
This reverts commit 2cd45a5043, reversing
changes made to d8423071de.
2016-09-21 12:03:56 -07:00
Fabien Potencier
2cd45a5043 minor #20011 Use UUID for error codes for Form validator. (Koc)
This PR was submitted for the 2.8 branch but it was merged into the 2.7 branch instead (closes #20011).

Discussion
----------

Use UUID for error codes for Form validator.

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | tiny, but it allowed http://symfony.com/doc/current/contributing/code/bc.html#changing-classes
| Deprecations? | no
| Tests pass?   | I hope so :)
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

6dbb186 Use UUID for error codes for Form validator.
2016-09-21 10:52:48 -07:00
Konstantin.Myakshin
6dbb186f23 Use UUID for error codes for Form validator. 2016-09-21 10:52:48 -07:00
Fabien Potencier
d8423071de bug #20010 [DX] Fixed regression when exception message swallowed when logging it. (Koc)
This PR was merged into the 2.7 branch.

Discussion
----------

[DX] Fixed regression when exception message swallowed when logging it.

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | maybe, wait for Travis
| Fixed tickets | fixed regression introduced in #13418
| License       | MIT
| Doc PR        | -

The problem is: after merging referenced PR we cann't understand what error occured and why authentication request failed (see attached screenshot). Previously it displays exception message, but now it only displays class of the exception.

![9003644109](https://cloud.githubusercontent.com/assets/191082/18717550/f0df61c4-8028-11e6-8dbb-684e4928e913.jpg)

Commits
-------

042cb6b Fixed regression when exception message swallowed when logging it.
2016-09-21 10:05:38 -07:00
Konstantin.Myakshin
3693e8368f Use UUID for error codes for Form validator. 2016-09-21 19:22:38 +03:00
Konstantin.Myakshin
042cb6b2b2 Fixed regression when exception message swallowed when logging it. 2016-09-21 18:21:51 +03:00