Commit Graph

8312 Commits

Author SHA1 Message Date
Victor Berchet
e3cf37fe84 [HttpFoundation] RedirectResponse: add the ability to retrieve the target URL, add unit tests 2012-02-06 19:09:24 +01:00
Victor Berchet
50c85aef24 [WebProfiler] Add info to the router panel 2012-02-06 19:08:49 +01:00
Victor Berchet
0d4d7e0b9b [WebProfilerBundle] Make the toolbar use the common JS 2012-02-06 18:41:13 +01:00
Victor Berchet
a440279e5f [WebProfilerBundle] Adds panel pages
Conflicts:

	src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/request.html.twig
2012-02-06 18:40:46 +01:00
Victor Berchet
762d90d859 [Profiler] Buid a common infrastructure 2012-02-06 18:39:12 +01:00
Victor Berchet
3896fdd6ef [WebProfilerBundle] Some cleanup 2012-02-06 18:27:38 +01:00
Fabien Potencier
5676a91b8d updated CHANGELOG for 2.1 2012-02-06 17:45:32 +01:00
Fabien Potencier
8c11e9baa7 merged branch thesalla/mapfiledumper (PR #2471)
Commits
-------

ba3b321 [ClassLoader] Added a class map file generator utility

Discussion
----------

[ClassLoader] Added a class map file generator utility

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2407

---------------------------------------------------------------------------

by lsmith77 at 2011-11-30T19:33:52Z

@thesalla do you have time/interest to finish this up?

---------------------------------------------------------------------------

by thesalla at 2011-12-01T09:55:50Z

sure (will attempt at least), but no sooner than tomorrow

---------------------------------------------------------------------------

by stof at 2011-12-12T20:41:41Z

@thesalla @fabpot what is the state of this PR ?

---------------------------------------------------------------------------

by thesalla at 2011-12-17T19:36:58Z

If you don't have any other suggestions or ideas, I'd consider it finished.

---------------------------------------------------------------------------

by lsmith77 at 2012-01-24T09:27:12Z

ping

---------------------------------------------------------------------------

by fabpot at 2012-02-02T08:21:38Z

@thesalla: Can you rename the ClassMapDumper class to ClassMapGenerator and then squash your commit before the merge? Thanks.

---------------------------------------------------------------------------

by thesalla at 2012-02-04T12:55:48Z

@fabpot done.
2012-02-06 17:45:10 +01:00
Fabien Potencier
aa1676c7b5 merged branch henrikbjorn/doctrine-unique-validator (PR #3275)
Commits
-------

928e352 Change the array access used in UniqueEntityValidator

Discussion
----------

[DoctrineBridge] Change the array access used in UniqueEntityValidator

MongoDB ODM Cursor does not implement ArrayAccess and therefor using
`$result[0]` will fail. `reset()` rewinds the array and returns the
first element value.

DoctrineMongoDBBundle#77

/cc @beberlei

---------------------------------------------------------------------------

by henrikbjorn at 2012-02-06T08:09:25Z

Made a mistake, the findBy call would still return a cursor. Changed the findBy to findOneBy we only want one result anyway.

---------------------------------------------------------------------------

by stof at 2012-02-06T08:11:26Z

findOneBy is wrong: you will not detect duplicate anymore if you return a single element

---------------------------------------------------------------------------

by henrikbjorn at 2012-02-06T08:28:03Z

@stof before it was only the first result that was used anyway so if it had found 3 results it would only have used the first one. Performance is apparently the biggest issue with findOneBy so this have been reverted.

---------------------------------------------------------------------------

by stof at 2012-02-06T08:31:17Z

@henrikbjorn no, we use other results too: if ``count()`` is not 1, the validation fails

---------------------------------------------------------------------------

by stof at 2012-02-06T08:36:06Z

Btw, running the testsuite would have tell you there is an issue when using findOneBy as it was breaking a test :)

---------------------------------------------------------------------------

by bschussek at 2012-02-06T10:45:44Z

Why doesn't this validator use a SELECT COUNT anyway?

---------------------------------------------------------------------------

by stof at 2012-02-06T10:57:00Z

@bschussek because we need to check if an existing value is for the same object or another one. Otherwise, the valdiation would fail as soon as you are editing an existing object without changing the unique value

---------------------------------------------------------------------------

by henrikbjorn at 2012-02-06T11:03:40Z

@stof @bschussek other changes that should be done? Else it should be ready to be merged ?

---------------------------------------------------------------------------

by henrikbjorn at 2012-02-06T13:00:57Z

@stof done an rebased.

---------------------------------------------------------------------------

by bschussek at 2012-02-06T13:04:44Z

👍 /cc @fabpot
2012-02-06 14:06:46 +01:00
Henrik Bjørnskov
928e352d09 Change the array access used in UniqueEntityValidator
convert iterator to array if it isnt already (mongodb)

More specific if

Dont do iterator_to_array if object implements \ArrayAccess

CS fix
2012-02-06 14:00:20 +01:00
Fabien Potencier
9855886dc5 merged branch grizlik/master (PR #3261)
Commits
-------

b65a997 [Form] Added test ChoiceList::testGetChoicesForValuesCorrectOrderingOfResult for correct ordering check
a60daff [Form] Fixed incorrect sorting in ChoiceList::getChoicesForValues

Discussion
----------

[Form] Fixed incorrect sorting in ChoiceList::getChoicesForValues

ChoiceList::getChoicesForValues return collection with sorting, that not corresponding to the sorting for input keys

---------------------------------------------------------------------------

by bschussek at 2012-02-03T21:40:49Z

Can you adapt the test cases to fail for this case please? (probably by use of assertSame instead of assertEquals in one of the existing tests)

---------------------------------------------------------------------------

by grizlik at 2012-02-04T08:41:44Z

I need to create a new test or modify an existing one?

---------------------------------------------------------------------------

by bschussek at 2012-02-04T09:58:04Z

Something like this in ChoiceListTest:

    public function testGetChoicesForValuesReverseOrderedValues()
    {
        $values = array('2', '1');
        $this->assertSame(array($this->obj3, $this->obj2), $this->list->getChoicesForValues($values));
    }
2012-02-06 09:56:24 +01:00
Fabien Potencier
c75ca12140 merged branch bschussek/issue3269 (PR #3270)
Commits
-------

78c1451 [Validator] Throwing exception in ConstraintValidator::setMessage() if initialize() wasn't called

Discussion
----------

[Validator] Throwing exception in ConstraintValidator::setMessage() if initialize() wasn't called

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -

![Travis Build Status](https://secure.travis-ci.org/bschussek/symfony.png?branch=issue3269)

---------------------------------------------------------------------------

by Maks3w at 2012-02-05T09:52:21Z

One problem was that. Now I initialized the unit test with a execution
context mockup and works good.

Another problem I found is in the rules for upgrade from 2.0 to
2.1:

In v2.0: with setMessages() only one argument is mandatory ($message)
In v2.1: With the new way, addViolation(), then you need 2 arguments.
But, in v2.0 with the new way, addViolation, required 3 arguments.

So for preserve forward and backward compatibility, you need pass 3
arguments to addViolation()  I think that it is helpfull and could be written in the
doc.

At the last one ¿What is the purpose of the third argument? ¿Can I pass
any object as invalid value?

Thanks

---------------------------------------------------------------------------

by bschussek at 2012-02-05T10:45:16Z

The last argument should always be the validated value that caused the constraint to fail.
2012-02-06 09:53:04 +01:00
Fabien Potencier
1bef14a02a [Process] fixed usage of constants in closure 2012-02-06 07:00:39 +01:00
Fabien Potencier
7581c3b221 merged branch willdurand/fix-propel-bridge (PR #3274)
Commits
-------

80682ba Fixed CS
007de8c [Tests] [Propel] Added some tests for the ModelChoiceList class
8257efd [Propel] Refactored the whole ModelChoiceList

Discussion
----------

Fix propel bridge

Ok, so I rewrote the `ModelChoiceList` based on the `EntityChoiceList`, and I provided the same test suite.
Sorry for the last PR, it was a fix to avoid fatal..

Cheers,
William
2012-02-06 06:57:03 +01:00
William DURAND
80682ba3c9 Fixed CS 2012-02-06 00:17:29 +01:00
William DURAND
007de8c265 [Tests] [Propel] Added some tests for the ModelChoiceList class 2012-02-05 23:08:07 +01:00
William DURAND
8257efd38f [Propel] Refactored the whole ModelChoiceList 2012-02-05 23:08:06 +01:00
Fabien Potencier
c2e8a0a24a [Process] added some constant to avoid harcoded strings 2012-02-05 12:11:37 +01:00
Fabien Potencier
766b88fd21 [HttpKernel] added support for FlattenException in ExceptionHandler::createResponse 2012-02-05 12:11:13 +01:00
Bernhard Schussek
78c145196b [Validator] Throwing exception in ConstraintValidator::setMessage() if initialize() wasn't called 2012-02-05 10:03:22 +01:00
Gyula Sallai
ba3b321842 [ClassLoader] Added a class map file generator utility
fixed cs

Small refactoring for Finder support

If class name found, return

Find multiple classes and namespaces in the same file

fixed problems with inheritance and non-php files

Renamed ClassMapDumper to ClassMapGenerator

fixed error with splfileinfo
2012-02-04 13:48:25 +01:00
grizlik
b65a9972fb [Form] Added test ChoiceList::testGetChoicesForValuesCorrectOrderingOfResult for correct ordering check 2012-02-04 14:14:29 +04:00
Fabien Potencier
6e60967827 [DoctrineBridge] fixed a unit test after the 2.0 merge 2012-02-04 08:08:27 +01:00
Fabien Potencier
b1148e334f merged 2.0 2012-02-04 08:03:45 +01:00
Fabien Potencier
79a957be77 merged branch kbond/config_dump_command (PR #3187)
Commits
-------

4847d3a renamed command
e97af0b code fixes
df94282 [FrameworkBundle] removed unnecessary DebugCommand
fa32885 [SecurityBundle] added configuration info
2f8ad93 [MonologBundle] added configuration info
9757958 [FrameworkBundle] added configuration info
58939f1 [TwigBundle] added configuration docs
8dc40e4 [FrameworkBundle] added config:dump console command

Discussion
----------

Config dump command

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #1663
Todo: add more config info/examples

[![Build Status](https://secure.travis-ci.org/kbond/symfony.png?branch=config_dump_command)](http://travis-ci.org/kbond/symfony)

This is a config dump command based on the additions of PR #1099.  This was initially part of that PR and there is some discussion there about it (https://github.com/symfony/symfony/pull/1099)

### Usage:

1. dump by root node: ``app/console config:dump framework``
2. dump by bundle name: ``app/console config:dump FrameworkBundle``

A few issues/notes:

* Only dumps to yaml
* Only 1 configuration per bundle (this was brought by @stof here: https://github.com/symfony/symfony/pull/1099#issuecomment-1242993)
* Works out of the box for most bundles but not ones that use a non-standard ``Configuration`` class (such as the assetic bundle).  In this case ``Extension::getConfiguration()`` must be configurated.

I have used it to create some (most) of the config reference docs.  It works fine but I find it somewhat crude, any suggestions to improve it would be appreciated.

---------------------------------------------------------------------------

by kbond at 2012-01-24T21:00:43Z

Few more issues:

1. Should I abstract the logic to a "normalizer" class that converts the Configuration class into a manageable array?  I struggle with this idea because isn't that what ``TreeBuilder`` basically is?
2. @stof made a good point that ``config:dump`` doesn't really describe what this does.  Would dumping your config be useful?  Perhaps ``config:dump framework`` dumps the config for your project while ``config:dump --ref framework`` dumps the default reference?

---------------------------------------------------------------------------

by stof at 2012-01-24T21:18:15Z

@kbond you cannot really dump the config. Part of it does not go through these extensions at all. And it does not make much sense anyway IMO.
the command as is does the right job IMO (i.e. dumping a reference for the extension). But its name should be improved

---------------------------------------------------------------------------

by kbond at 2012-01-24T21:20:51Z

``config:reference`` perhaps?

---------------------------------------------------------------------------

by fabpot at 2012-02-02T10:05:19Z

This command is about displaying the default configuration for a given bundle. So, what about `config:dump-reference`? As I understand, the command name is the last element to figure out before merging, right?

---------------------------------------------------------------------------

by stof at 2012-02-02T10:19:49Z

@fabpot indeed.

---------------------------------------------------------------------------

by stof at 2012-02-02T10:34:16Z

and +1 for ``config:dump-reference``

---------------------------------------------------------------------------

by Tobion at 2012-02-02T12:08:03Z

why not use the words you chose yourself: `config:dump-default`
I think it's more explicit.
2012-02-04 08:01:13 +01:00
Fabien Potencier
5251177002 merged branch helmer/readonly_fix (PR #3258)
Commits
-------

8321593 [Form] DRYed ChoiceType
0753cee [Form] Fixed read_only attribute for expanded fields

Discussion
----------

[Form] Fixed read_only attribute for expanded fields

Expanded choice widgets lose the knowledge of read_only attribute value.

Fixes bug introduced by #3193

---------------------------------------------------------------------------

by helmer at 2012-02-02T16:24:50Z

Please hold before merging, @bschussek had some thoughts about my changes in ``ChoiceType``, waiting for feedback.

---------------------------------------------------------------------------

by bschussek at 2012-02-02T16:33:12Z

I'm fine with the refactoring then, but please split it into two commits at least. The changes in ChoiceType have nothing in common with the actual issue here.

---------------------------------------------------------------------------

by helmer at 2012-02-02T19:40:39Z

Tests added.

---------------------------------------------------------------------------

by bschussek at 2012-02-03T10:14:32Z

Great, thanks.

@fabpot 👍
2012-02-04 07:59:57 +01:00
Fabien Potencier
c9e87491b4 merged branch stof/unescape_paramaters (PR #3260)
Commits
-------

a7b48c0 Renamed the method
8e13095 Fixed the unescaping of parameters to handle arrays
045f936 Changed the testcase to expect the unescaping only after the resolution
a1b6d4c Added a failing testcase for escaped % in array parameters

Discussion
----------

Unescape paramaters

This fixes the unescaping of % in parameters when it is used in an array.

It is a replacement for @lsmith77's work done in #3241 but with a working fix this time :)
2012-02-04 07:58:12 +01:00
Fabien Potencier
ffef177c4a merged branch willdurand/fix-propel-bridge (PR #3266)
Commits
-------

3c227fd [Propel] Fixed naming due to changes in #87b16e7015c02e794c33dbfc05812cf070b4ac68

Discussion
----------

[Propel] Fixed naming due to changes in #87b16e7015c02e794c33dbfc05812cf070b4ac68

+ minor CS fix

I'll provide unit tests for the Propel bridge in a separate PR.
2012-02-04 07:43:54 +01:00
William DURAND
3c227fdd74 [Propel] Fixed naming due to changes in #87b16e7015c02e794c33dbfc05812cf070b4ac68
+ minor CS fix
2012-02-03 23:06:29 +01:00
Sebastian Hörl
411a0ccbdd [Validator] Added GroupSequenceProvider to changelog 2012-02-03 17:45:10 +01:00
grizlik
a60daffb47 [Form] Fixed incorrect sorting in ChoiceList::getChoicesForValues 2012-02-03 14:21:24 +04:00
Helmer Aaviksoo
8321593c85 [Form] DRYed ChoiceType 2012-02-03 11:49:06 +02:00
Helmer Aaviksoo
0753cee11a [Form] Fixed read_only attribute for expanded fields 2012-02-03 11:49:06 +02:00
Sebastian Hörl
815c769292 [Validator] Renamed getValidationGroups to getGroupSequence 2012-02-02 20:27:50 +01:00
Sebastian Hörl
d84a2e4bdf [Validator] Updated test expectations 2012-02-02 20:27:50 +01:00
Sebastian Hörl
9f2310b2f8 [Validator] Fixed typos, renamed hasGroupSequenceProvider 2012-02-02 20:27:50 +01:00
Sebastian Hörl
e0d28284fc [Validator] GroupSequenceProvider tests improved, configuration changed 2012-02-02 20:27:50 +01:00
Sebastian Hörl
c3b04a3336 [Validator] Changed GroupSequenceProvider implementation 2012-02-02 20:27:50 +01:00
Sebastian Hörl
6c4455fef7 [Validator] Added GroupSequenceProvider 2012-02-02 20:27:49 +01:00
Christophe Coevoet
a7b48c058b Renamed the method 2012-02-02 18:59:53 +01:00
Christophe Coevoet
8e13095e5c Fixed the unescaping of parameters to handle arrays 2012-02-02 18:34:11 +01:00
Christophe Coevoet
045f936038 Changed the testcase to expect the unescaping only after the resolution
String values are not unescaped either in resolveValue() because it can
be called several times for the same parameter.
2012-02-02 18:34:05 +01:00
lsmith77
a1b6d4c46b Added a failing testcase for escaped % in array parameters 2012-02-02 18:33:55 +01:00
kbond
4847d3ad35 renamed command 2012-02-02 11:47:41 -05:00
Fabien Potencier
2cd246786d merged branch bschussek/issue3239 (PR #3256)
Commits
-------

8714d79 [Form] Simplified code in MergeCollectionListener
8ab982a [Form] Fixed: Custom add and remove method are not invoked if disallowed
02f61ad [Form] Renamed choice and collection options "adder_prefix" and "remover_prefix" to "add_method" and "remove_method" and allowed to specify full method names
b393774 [Form] Used direct method access in MergeCollectionListener instead of Reflection to avoid problems when using class hierarchies
d208f4e [Form] Made it possible to use models with only either addXxx() or removeXxx()

Discussion
----------

[Form] Fixed edge cases in MergeCollectionListener

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -

![Travis Build Status](https://secure.travis-ci.org/bschussek/symfony.png?branch=issue3239)

Fixes an issue mentioned in the comments of #3239

see https://github.com/symfony/symfony/pull/3239#issuecomment-3776312

---------------------------------------------------------------------------

by bschussek at 2012-02-02T12:12:17Z

Wait a minute before merging this.

---------------------------------------------------------------------------

by bschussek at 2012-02-02T13:01:55Z

@fabpot Ready to merge
2012-02-02 17:28:40 +01:00
Fabien Potencier
df2ad15768 merged branch bschussek/issue2861 (PR #3257)
Commits
-------

bd461e2 [Form] Forms now don't create empty objects anymore if they are completely empty and not required. The empty data for these forms is null.

Discussion
----------

[Form] Forms now don't create empty objects anymore if they are empty and not required

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2861
Todo: -

![Travis Build Status](https://secure.travis-ci.org/bschussek/symfony.png?branch=issue2861)

If a form (or a nested form) is left completely empty upon submission and is not required, no new data object will be generated anymore. Instead, the form returns null as data.
2012-02-02 17:23:50 +01:00
Bernhard Schussek
8714d7924e [Form] Simplified code in MergeCollectionListener 2012-02-02 14:45:39 +01:00
Bernhard Schussek
bd461e295d [Form] Forms now don't create empty objects anymore if they are completely empty and not required. The empty data for these forms is null. 2012-02-02 14:40:19 +01:00
Kevin Bond
e97af0bac0 code fixes 2012-02-02 08:20:37 -05:00
kbond
df94282dab [FrameworkBundle] removed unnecessary DebugCommand 2012-02-02 08:20:37 -05:00