Commit Graph

16816 Commits

Author SHA1 Message Date
Fabien Potencier
5ab9c3b3ca Merge branch '2.3' into 2.4
* 2.3:
  Revert "Fix "Array was modified outside object" in ResizeFormListener."
  Added failing test
  bumped Symfony version to 2.3.11
  updated VERSION for 2.3.10
  update CONTRIBUTORS for 2.3.10
  updated CHANGELOG for 2.3.10
  [Console] removed problematic regex
  [DomCrawler] Added support for <area> tags to be treated as links
  Fix "Array was modified outside object" in ResizeFormListener.

Conflicts:
	src/Symfony/Component/HttpKernel/Kernel.php
2014-02-18 16:41:06 +01:00
Jordi Boggiano
714aee9bc0 Bypass sigchild detection if phpinfo is not available 2014-02-18 14:12:33 +01:00
Stéphane PY
b949c49f26 [2.4][HttpKernel] Fix issue #10209
When the profiler has `only_exception` option activated and a subrequest
throw an exception, the parent profile cannot be found.

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT
2014-02-18 11:56:22 +01:00
Fabien Potencier
c4ffe02100 bug #10269 [Form] Revert "Fix "Array was modified outside object" in ResizeFormListener." (norzechowicz)
This PR was merged into the 2.3 branch.

Discussion
----------

[Form] Revert "Fix "Array was modified outside object" in ResizeFormListener."

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

Unseting key on iterator is not an solution because in php "Array assignment always involves value copying. " So if \IteratorAggregate implementation create new iterator from array (just like [Doctrine ArrayCollection](https://github.com/doctrine/common/blob/2.3/lib/Doctrine/Common/Collections/ArrayCollection.php#L362) does)  such operation will not affect original data.

I'm just not sure if it's good to use Doctirn ArrayCollection in this test case or maybe its better to create own implementation of such Collection as a fixture.

Commits
-------

f62e30d Revert "Fix "Array was modified outside object" in ResizeFormListener."
462b7af Added failing test
2014-02-17 20:52:05 +01:00
Nicolas Grekas
6de362b9fb [Debug] error stacking+fatal screaming+case testing 2014-02-16 11:08:14 +01:00
Norbert Orzechowicz
f62e30db30 Revert "Fix "Array was modified outside object" in ResizeFormListener." 2014-02-15 12:03:01 +01:00
Norbert Orzechowicz
462b7af9b1 Added failing test 2014-02-15 12:00:54 +01:00
Grégoire Pineau
19a368e068 [FramworkBundle] Added config:debug command 2014-02-13 15:16:29 +01:00
Grégoire Pineau
34f4ef5297 [FrameworkBundle][Console] Load command from DIC after command from bundles.
It's better to load a command from DIC after other one. Because it
allow easy override of default (symfony/assetic/doctrine) command.
The end user could do:

    # config.yml
    services:
        assetic.command.dump:
            class: SensioLabs\Shim\Assetic\DumpCommand
            tags:
                - { name: console.command }
2014-02-13 15:09:55 +01:00
Andrej Hudec
a25d1e1c0f Fixed wrong redirect url if path contains some query parameters 2014-02-13 06:42:11 +01:00
Fabien Potencier
82d9a76996 bumped Symfony version to 2.4.3 2014-02-12 22:00:41 +01:00
Fabien Potencier
b70633f92f updated VERSION for 2.4.2 2014-02-12 20:27:03 +01:00
Fabien Potencier
6d430f5a1d updated CHANGELOG for 2.4.2 2014-02-12 20:26:54 +01:00
Fabien Potencier
8fef4f0398 bumped Symfony version to 2.3.11 2014-02-12 20:09:40 +01:00
Fabien Potencier
e4b9ff28b7 updated VERSION for 2.3.10 2014-02-12 09:18:23 +01:00
Fabien Potencier
a1b099df8f update CONTRIBUTORS for 2.3.10 2014-02-12 09:17:42 +01:00
Fabien Potencier
e4d1d048e1 updated CHANGELOG for 2.3.10 2014-02-12 09:15:48 +01:00
Fabien Potencier
6fc06e72b8 bug #10231 [Console] removed problematic regex (fabpot)
This PR was merged into the 2.3 branch.

Discussion
----------

[Console] removed problematic regex

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

This PR is a quick implementation of a replacement fora problematic regex.

Commits
-------

80bc41e [Console] removed problematic regex
2014-02-12 09:04:19 +01:00
Fabien Potencier
80bc41e38d [Console] removed problematic regex 2014-02-12 08:53:27 +01:00
Fabien Potencier
8cd285cd2c bug #10245 [DomCrawler] Added support for <area> tags to be treated as links (shamess)
This PR was merged into the 2.3 branch.

Discussion
----------

[DomCrawler] Added support for <area> tags to be treated as links

The [HTML area tag](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/area) behaves exactly like the `a` tag in that they're both clickable, and if it has a `href` follows a link. The Link class works the same with both tags.

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

Commits
-------

23acd26 [DomCrawler] Added support for <area> tags to be treated as links
2014-02-12 07:33:07 +01:00
Fabien Potencier
a68d69183d minor #10243 Various minor changes (for 2.4) (fabpot)
This PR was submitted for the 2.4-dev branch but it was merged into the 2.4 branch instead (closes #10243).

Discussion
----------

Various minor changes (for 2.4)

| 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

Commits
-------

19f79c3 fixed various inconsistencies
2014-02-11 16:39:28 +01:00
Fabien Potencier
a6b1247689 fixed various inconsistencies 2014-02-11 16:39:28 +01:00
Shane Preece
23acd26d4a [DomCrawler] Added support for <area> tags to be treated as links 2014-02-11 14:35:22 +00:00
Fabien Potencier
57a4942812 bug #10232 [Form] Fix "Array was modified outside object" in ResizeFormListener. (Chekote)
This PR was submitted for the 2.4 branch but it was merged into the 2.3 branch instead (closes #10232).

Discussion
----------

[Form] Fix "Array was modified outside object" in ResizeFormListener.

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

The onSubmit() method of the ResizeFormListener class is assuming the data is an array, and calling unset directly inside a foreach. This works fine in most scenarios, but if data is an instance of IteratorAggregate, it breaks with the following error:

Symfony\Component\Form\Extension\Core\EventListener\ResizeFormListener::onSubmit(): ArrayIterator::next(): Array was modified outside object and internal position is no longer valid in ./vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php line 142

This is because the foreach loop is using an Iterator in the background, but the ResizeFormListener has unset the underlying data directly, causing the Iterator and data to be out of sync. When the data is an instance of IteratorAggregate, the loop should use the iterator directly and not rely on foreach.

The onSubmit method has been updated accordingly.

Commits
-------

4116b6e Fix "Array was modified outside object" in ResizeFormListener.
2014-02-11 15:26:59 +01:00
Chekote
e62c0b5a2d Fix "Array was modified outside object" in ResizeFormListener.
The onSubmit() method of the ResizeFormListener class is assuming the data is an array, and calling unset directly inside a foreach. This works fine in most scenarios, but if data is an instance of IteratorAggregate, it breaks with the following error:

Symfony\Component\Form\Extension\Core\EventListener\ResizeFormListener::onSubmit(): ArrayIterator::next(): Array was modified outside object and internal position is no longer valid in ./vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php line 142

This is because the foreach loop is using an Iterator in the background, but the ResizeFormListener has unset the underlying data directly, causing the Iterator and data to be out of sync. When the data is an instance of IteratorAggregate, the loop should use the iterator directly and not rely on foreach.

The onSubmit method has been updated accordingly.
2014-02-11 15:26:59 +01:00
Fabien Potencier
f828aee7f7 Merge branch '2.4'
* 2.4:
  fixed various inconsistencies
  reduced recursion when building DumperPrefixCollection
  renamed variables - making next change more readable
  removing dead code.
  [ExpressionLanguage] added some tests for the built-in constant() function
  [ExpressionLanguage] added some documentation about functions
  [DomCrawler] Fixed filterXPath() chaining
  [DomCrawler] Fixed incorrect handling of image inputs
2014-02-11 14:52:21 +01:00
Fabien Potencier
e2ac5dfc78 Merge branch '2.3' into 2.4
* 2.3:
  fixed various inconsistencies
  reduced recursion when building DumperPrefixCollection
  renamed variables - making next change more readable
  removing dead code.
  [DomCrawler] Fixed filterXPath() chaining
  [DomCrawler] Fixed incorrect handling of image inputs

Conflicts:
	src/Symfony/Component/DomCrawler/Crawler.php
	src/Symfony/Component/EventDispatcher/Tests/EventDispatcherTest.php
	src/Symfony/Component/Form/Extension/DependencyInjection/DependencyInjectionExtension.php
	src/Symfony/Component/Serializer/Tests/Normalizer/CustomNormalizerTest.php
	src/Symfony/Component/Templating/Tests/Loader/CacheLoaderTest.php
	src/Symfony/Component/Templating/Tests/Loader/LoaderTest.php
2014-02-11 14:52:09 +01:00
Fabien Potencier
a1813cb57a minor #10234 Various minor changes (fabpot)
This PR was merged into the 2.3 branch.

Discussion
----------

Various minor changes

| 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

Commits
-------

eb3f6c6 fixed various inconsistencies
2014-02-11 11:41:52 +01:00
Fabien Potencier
eb3f6c6efb fixed various inconsistencies 2014-02-11 11:29:24 +01:00
Fabien Potencier
f964cc8474 bug #10215 [Routing] reduced recursion in dumper (arnaud-lb)
This PR was submitted for the 2.3-dev branch but it was merged into the 2.3 branch instead (closes #10215).

Discussion
----------

[Routing] reduced recursion in dumper

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | sensiolabs/SensioFrameworkExtraBundle/issues/275
| License       | MIT

This reduces recursion in the route dumper, avoiding issues with xdebug's recursion limit.

Commits
-------

fa6eebc reduced recursion when building DumperPrefixCollection
9278b27 renamed variables - making next change more readable
2014-02-10 15:33:09 +01:00
Arnaud Le Blanc
979d5c0229 reduced recursion when building DumperPrefixCollection 2014-02-10 15:33:09 +01:00
Arnaud Le Blanc
e0cf2440e9 renamed variables - making next change more readable 2014-02-10 15:33:09 +01:00
Fabien Potencier
5fbcf88b9e minor #10219 [EventDispatcher] removing dead code. (inalgnu)
This PR was submitted for the 2.3-dev branch but it was merged into the 2.3 branch instead (closes #10219).

Discussion
----------

[EventDispatcher] removing dead code.

| 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]

Commits
-------

e28395f [EventDispatcher] removing dead code.
2014-02-10 15:31:47 +01:00
inalgnu
fdecc69e98 removing dead code. 2014-02-10 15:31:47 +01:00
Fabien Potencier
d0386e4a5c minor #10214 [3.0][Console] Added isVerbosity* to OutputInterface (lyrixx)
This PR was merged into the 2.5-dev branch.

Discussion
----------

[3.0][Console] Added isVerbosity* to OutputInterface

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

Now, only `Output` have theses methods. But in the `Command` class, `execute` receive an instance of `OutputInterface`. So, to avoid coding against an implementation, theses method should be added to the interface.

Commits
-------

816b295 [3.0][Console] Added isVerbosity* to OutputInterface
2014-02-10 15:30:52 +01:00
Fabien Potencier
4ab78e0561 minor #10222 [ExpressionLanguage] added some documentation about functions (fabpot)
This PR was merged into the 2.4 branch.

Discussion
----------

[ExpressionLanguage] added some documentation about functions

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

This adds documentation about how to define a function in the expression language.

Commits
-------

600d481 [ExpressionLanguage] added some documentation about functions
2014-02-10 15:27:45 +01:00
Fabien Potencier
41cf1cc456 minor #10223 [ExpressionLanguage] added some tests for the built-in constant() function (fabpot)
This PR was merged into the 2.4 branch.

Discussion
----------

[ExpressionLanguage] added some tests for the built-in constant() function

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

Commits
-------

d8f55f5 [ExpressionLanguage] added some tests for the built-in constant() function
2014-02-10 15:27:11 +01:00
Fabien Potencier
d8f55f5872 [ExpressionLanguage] added some tests for the built-in constant() function 2014-02-10 08:08:57 +01:00
Fabien Potencier
600d48162a [ExpressionLanguage] added some documentation about functions 2014-02-10 07:34:14 +01:00
Grégoire Pineau
816b295c75 [3.0][Console] Added isVerbosity* to OutputInterface
Now, only `Output` have theses methods. But in the `Command` class, `execute` receive an instance of `OutputInterface`. So, to avoid coding an implementation, theses method should be added to the interface.
2014-02-07 17:08:27 +01:00
Fabien Potencier
fe86efd3f2 feature #10200 [EventDispatcher] simplified code for TraceableEventDispatcher (fabpot)
This PR was merged into the 2.5-dev branch.

Discussion
----------

[EventDispatcher] simplified code for TraceableEventDispatcher

| 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

Commits
-------

42e4c7b [EventDispatcher] simplified code for TraceableEventDispatcher
2014-02-06 12:23:12 +01:00
Fabien Potencier
6dfdb97f88 feature #10198 [Stopwatch] Allow getting duration of events without calling stop() (jochenvdv)
This PR was merged into the 2.5-dev branch.

Discussion
----------

[Stopwatch] Allow getting duration of events without calling stop()

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | [#10175](https://github.com/symfony/symfony/issues/10175)
| License       | MIT
| Doc PR        | [#3539](https://github.com/symfony/symfony-docs/pull/3539)

Commits
-------

2efe461 Allow retrieving unstopped stopwatch events
d3d097d Include running periods in duration
2014-02-05 17:42:00 +01:00
Fabien Potencier
c11c5888f3 bug #10207 [DomCrawler] Fixed filterXPath() chaining (robbertkl)
This PR was merged into the 2.3 branch.

Discussion
----------

[DomCrawler] Fixed filterXPath() chaining

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | debatable (see below)
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #10206
| License       | MIT
| Doc PR        |

As @stof mentions in #10206, each node in the Crawler can belong to a different \DOMDocument. Therefore, I've made each node do its own XPath, relative to itself, and add all the results to a new Crawler. This way, all resulting nodes are still part of their original \DOMDocument and thus can reach all of their parent nodes.

No current tests break on this change. I've added a new test for this case, by checking if the number of parents is correct after obtaining a node through chaining of `filterXPath()`.

Now for BC: I can think of a number of cases where this change would give a different result. However, it's debatable/unclear if:
- the old behavior was a bug in the first place (which would validate this change), or
- the old behavior was intended (which would make this a BC breaking change)

As an example, consider the following HTML:
```html
<div name="a"><div name="b"><div name="c"></div></div></div>
```
What would happen if we run this:
```php
echo $crawler->filterXPath('//div')->filterXPath('div')->filterXPath('div')->attr('name');
```
Aside from breaking reachability of the parent nodes by chaining, with the original code it would echo 'a'.
With this patch it would echo 'c', which, to me, makes more sense.

Commits
-------

43a7716 [DomCrawler] Fixed filterXPath() chaining
2014-02-05 17:38:09 +01:00
Robbert Klarenbeek
43a771614c [DomCrawler] Fixed filterXPath() chaining 2014-02-05 17:30:33 +01:00
Fabien Potencier
e453c4589d bug #10205 [DomCrawler] Fixed incorrect handling of image inputs (robbertkl)
This PR was merged into the 2.3 branch.

Discussion
----------

[DomCrawler] Fixed incorrect handling of image inputs

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

A possible approach to fix #10204, but I'm open to suggestions to fix this another way, as this might not be the most 'elegant' way.

Initially, my thoughts were to create a new DomCrawler\Field\FormField subclass, especially for image inputs. However, this does not solve the problem, because such a FormField would still exist under 1 name in the FormFieldRegistry.

Instead, I've changed it to have 2 separate FormFields instead (which both reference the same input node), with different names (.x and .y) so that both values can be set separately and will both be submitted.

Commits
-------

816cf17 [DomCrawler] Fixed incorrect handling of image inputs
2014-02-05 14:01:06 +01:00
Robbert Klarenbeek
816cf179ee [DomCrawler] Fixed incorrect handling of image inputs 2014-02-04 21:33:58 +01:00
Fabien Potencier
42e4c7bddf [EventDispatcher] simplified code for TraceableEventDispatcher 2014-02-04 16:16:44 +01:00
Fabien Potencier
bcb5239b5e bug #10199 fix ProcessPipes (nicolas-grekas)
This PR was merged into the 2.5-dev branch.

Discussion
----------

fix ProcessPipes

Commits
-------

076d417 fix ProcessPipes
2014-02-04 15:10:18 +01:00
Nicolas Grekas
076d417977 fix ProcessPipes 2014-02-04 14:50:18 +01:00
Fabien Potencier
22970e007e Merge branch '2.4'
* 2.4:
  added missing @deprecated tag
  Fixed recursion level incrementing in FlattenException::flattenArgs().
  [HttpKernel] fixed wrong reference in TraceableEventDispatcher

Conflicts:
	src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php
2014-02-04 12:21:37 +01:00