Commits
-------
dbaddbb [Form] Allow empty choices array for ChoiceType
Discussion
----------
[Form] Allow empty choices array for ChoiceType
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
The documentation about ChoiceType says, that default for 'choices' is array().
This is not allowed because an empty array evaluates to false:
if (!$options['choice_list'] && !$options['choices']) {
Use case: choices are empty and items are added dynamically.
---------------------------------------------------------------------------
by chmielot at 2012-02-07T21:03:03Z
Sorry, I messed up with the tickets. Didn't know a pull request opens a ticket.
---------------------------------------------------------------------------
by bschussek at 2012-02-08T08:23:29Z
This ticket depends on #3290 for being merged.
Apart from this, a test case is missing. Add this to ChoiceTypeTest:
// https://github.com/symfony/symfony/issues/3298
public function testInitializeWithEmptyChoices()
{
$this->factory->createNamed('choice', 'name', null, array(
'choices' => array(),
));
}
---------------------------------------------------------------------------
by craue at 2012-02-10T20:32:44Z
@bschussek: Why does it depend on #3290? I have issues with the `!$options['choices']` check even without #3290 applied.
---------------------------------------------------------------------------
by chmielot at 2012-02-10T21:24:28Z
Ok, I updated the branch with the test case and craue's suggestion on explicitly checking valid values.
---------------------------------------------------------------------------
by chmielot at 2012-02-11T09:07:05Z
Should be fine now.
---------------------------------------------------------------------------
by bschussek at 2012-02-11T09:15:10Z
Good. I see that you added a check for \Traversable too - can you add a test for this too? It should be fine to pass an empty \ArrayObject().
---------------------------------------------------------------------------
by craue at 2012-02-11T10:05:36Z
@bschussek: But even if there's passed something different than an array, the c'tor of `SimpleChoiceList` (which is called in line 45) is type hinted with `array` and won't allow passing a `Traversable` anyway, right?
---------------------------------------------------------------------------
by bschussek at 2012-02-11T10:16:36Z
@craue Yes. But in EntityType the choices option is reused and passed to EntityChoiceList, which extends ChoiceList and accepts any array or Traversable.
You're right though that it's not possible to add a test covering this in ChoiceTypeTest, and in EntityTypeTest this is already covered.
@fabpot Ready to merge.
Rename ArraySessionStorage to make it clear the session is a mock for testing purposes only.
Has BC class for ArraySessionStorage
Added sanity check when starting the session.
Fixed typos and incorrect php extension test method
session_module_name() also sets session.save_handler, so must use extension_loaded() to check if module exist
or not.
Respect autostart settings.
Session object now implements SessionInterface to make it more portable.
AbstractSessionStorage and SessionSaveHandlerInterface now makes implementation
of session storage drivers simple and easy to write for both custom save handlers
and native php save handlers and respect the PHP session workflow.
This commit outsources the flash message processing to it's own interface.
Overall flash messages now can have multiple flash types and each type can
store multiple messages. For convenience there are now four flash types
by default, INFO, NOTICE, WARNING and ERROR.
There are two concrete implementations: one preserving the old behaviour of
flash messages expiring exactly after one page load, regardless of being
displayed or not; and the other where flash messages persist until explicitly
popped.
This commit outsources session attribute storage to it's own class.
There are two concrete implementations, one with structured namespace storage and the other
without.
Commits
-------
ac59db7 cleanup
64ea95d [WebProfilerBundle] Add redirection info to the router panel
826bd23 [FrameworkBundle] fix phpDoc of ControllerResolver::createController()
e3cf37f [HttpFoundation] RedirectResponse: add the ability to retrieve the target URL, add unit tests
50c85ae [WebProfiler] Add info to the router panel
Discussion
----------
[WIP][Profiler] Routing
former #3206 part 3 (depends on part 1 - #3280)
The goal of this PR is to fix#3264 by adding redirection infos on the router panel.
Done:
* Add info on the target url / route
To do:
* Display an accurate URL matching process (when using the RedirectableUrlMatcher)
Commits
-------
0d4d7e0 [WebProfilerBundle] Make the toolbar use the common JS
a440279 [WebProfilerBundle] Adds panel pages
762d90d [Profiler] Buid a common infrastructure
Discussion
----------
[Profiler] Provide a common infrastructure
former #3206 part 3
* base JS (provides ajax, toggle, css class helpers),
* panel pages (used only by the Doctrine panel for now).
Successfuly tested with the (future version of the) Doctrine panel.