Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Form][Guesser] Symfony should guess a better field type for Doctrine 'array' type #1692

Closed
lmcd opened this issue Jul 14, 2011 · 9 comments
Closed
Labels
Enhancement Form Good first issue Ideal for your first contribution! (some Symfony experience may be required)
Milestone

Comments

@lmcd
Copy link
Contributor

lmcd commented Jul 14, 2011

Currently defaults to a textbox which just displays 'Array'.

@Gregwar
Copy link
Contributor

Gregwar commented Sep 26, 2011

Symfony don't use Doctrine mapping to do the field guessing but validation constraints.

Maybe @Assert\Type(type="array") should be guessed as a collection type...

@stof
Copy link
Member

stof commented Sep 26, 2011

Symfony uses both for the guessing

@Gregwar
Copy link
Contributor

Gregwar commented Sep 26, 2011

@stof, right, sorry. guessing for collection with doctrine array are even here, but commented

<?php
//... 
 53             //case 'array':
 54             //  return new TypeGuess('Collection', array(), Guess::HIGH_CONFIDENCE);
//...

@Gregwar
Copy link
Contributor

Gregwar commented Sep 26, 2011

Can't get far enough in the history of the guesser to understand why it's commented, any information ? Moreover, why there is an uppercase C on Collection ? Is is because a long time ago types began with upercases ?

@stof
Copy link
Member

stof commented Sep 26, 2011

Reading the history, this is commented since the first implementation of the guesser: 3bf9f77

@stof
Copy link
Member

stof commented Apr 4, 2012

@bschussek what was the reason to comment the guessing for the array fields ?

@webmozart
Copy link
Contributor

@stof Simply that I didn't know what to do back then. What should we guess? "collection"?

@vicb
Copy link
Contributor

vicb commented Apr 13, 2012

Task for the BHD: guess collection for both Doctrine arrays & @Assert\Type(type="array")

@pvanliefland
Copy link

Working on it right now

@fabpot fabpot closed this as completed in 8bdff01 Apr 19, 2012
fabpot added a commit that referenced this issue Apr 19, 2012
Commits
-------

8bdff01 [DoctrineBridge][Form] added collection guess for array Doctrine type and array constraint type

Discussion
----------

[Form] [DoctrineBridge] Better field type guessing for array doctrine type and array validator type

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

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

by bschussek at 2012-04-18T08:45:17Z

Could you please add an entry to the CHANGELOG and squash your commits into one?

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

by pvanliefland at 2012-04-18T17:20:39Z

Done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Form Good first issue Ideal for your first contribution! (some Symfony experience may be required)
Projects
None yet
Development

No branches or pull requests

7 participants