Commit Graph

16858 Commits

Author SHA1 Message Date
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
jochenvdv
2efe461a46 Allow retrieving unstopped stopwatch events
Section:
  - added method getEvent()

Stopwatch:
  - added method getEvent()

StopwatchTest:
  - modified testStart() to test for getEvent() method
  - added testUnknownEvent()
2014-02-04 12:05:45 +01:00
Fabien Potencier
aca1686895 Merge branch '2.3' into 2.4
* 2.3:
  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 11:54:30 +01:00
jochenvdv
d3d097d659 Include running periods in duration
StopwatchEvent:
  - method getDuration() now includes periods that are not stopped yet

StopwatchEventTest:
  - added testDurationBeforeStop()
2014-02-04 11:29:47 +01:00
Fabien Potencier
bea1537964 minor #10186 Made some HHVM-related fixes (fabpot)
This PR was merged into the 2.5-dev branch.

Discussion
----------

Made some HHVM-related fixes

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

1240758 [Routing] fixed CS
e223395 [Debug] fixed case differences between PHP and HHVM (classes are case-insensitive anyway in PHP)
23acc24 [Debug] made order of suggestions predictable in error messages
2014-02-04 08:17:17 +01:00
Fabien Potencier
6a4d765c43 bug #10191 [HttpKernel] fixed wrong reference in TraceableEventDispatcher (fabpot)
This PR was merged into the 2.3 branch.

Discussion
----------

[HttpKernel] fixed wrong reference in TraceableEventDispatcher

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

This PR fixes #9748 and #9727 by removing the `id` state. Only private method signatures have been changed, so that qualifies for a fix in 2.3.

The `getNotCalledListeners()` is a bit special as it tries to get non-called listeners. It passes `null` as the event id as if a listener has been called more than once, getting the first call is enough.

Commits
-------

acd3317 [HttpKernel] fixed wrong reference in TraceableEventDispatcher
2014-02-04 08:14:12 +01:00
Fabien Potencier
5e12d749eb minor #10188 [TwigBundle] added missing @deprecated tag (fabpot)
This PR was submitted for the 2.3-dev branch but it was merged into the 2.3 branch instead (closes #10188).

Discussion
----------

[TwigBundle] added missing @deprecated tag

Commits
-------

ee08582 [TwigBundle] added missing @deprecated tag
2014-02-04 08:13:30 +01:00
Fabien Potencier
fefd4df4a5 added missing @deprecated tag 2014-02-04 08:13:29 +01:00
Fabien Potencier
7a1190874f bug #10195 [Debug] Fixed recursion level incrementing in FlattenException::flattenArgs(). (sun)
This PR was submitted for the 2.3-dev branch but it was merged into the 2.3 branch instead (closes #10195).

Discussion
----------

[Debug] Fixed recursion level incrementing in FlattenException::flattenArgs().

The internal `$level` variable for tracking the recursion level is pre-incremented on the parent level of the recursion already.

This causes later array elements in an array that has more than 10 elements to get obscured by `'*DEEP NESTED ARRAY*'`, even though the elements are on the first/top level of the array.

The incremented `$level` value needs to be passed to the recursive call to `FlattenException::flattenArgs()` only.

Discovered in debugging exceptions in Drupal (which happens to use very large multi-dimensional arrays for legacy reasons).

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

Commits
-------

1b1501b Fixed recursion level incrementing in FlattenException::flattenArgs().
2014-02-04 08:06:39 +01:00