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

I have a problem on selected values when it is a collection of choices #1711

Closed
qianyixian opened this issue Jul 16, 2017 · 1 comment
Closed

Comments

@qianyixian
Copy link

qianyixian commented Jul 16, 2017

Hi, I have a collection of values from some Table stored as simple_array type in a field.
So It should display like a collection of choices with all the values of some property from that Table.

For example, Suppose

  • Table Task: property ‘users’ and its type is simple_array
  • Table User: property 'name' and there are 3 rows: 'Lucy', 'Mike', 'Lily' .

So it should be like:

users
0 ---- choices ('Lucy'-'Lucy', 'Mike'-> 'Mike', 'Lily' ->'Lily')
1 ---- choices ('Lucy'-'Lucy', 'Mike'-> 'Mike', 'Lily' ->'Lily')
...
+add item
-delete item

It works well on creating a new task by the following configuration:

- { property: 'users', label: 'users', type: 'collection', type_options: {entry_type: 'Symfony\Bridge\Doctrine\Form\Type\EntityType', entry_options:  { class: 'myBundle\Entity\User', choice_label: 'name', choice_value:'name'}}}

It does not matter what choice values are (could be 'identity' as well). In the example, the choice values are 'Lucy', 'Mike', 'Lily'.

I choose 'Mike' and 'Lily', and the task is created.
Everything is OK.

The problem is:
when editing the task, I find the selected value is always the first value - 'Lucy', 'Lucy' instead of 'Mike', 'Lily'. Looking into Database, I found 'Mike' and 'Lily' have already been stored.

Could you help me solve this problem. Anything wrong or missing in configuration?
Thank you!

@qianyixian qianyixian changed the title I get a problem on selected values when it is a collection of choices I have a problem on selected values when it is a collection of choices Jul 16, 2017
@javiereguiluz
Copy link
Collaborator

I'm closing this issue because we're starting a new phase in the history of this bundle (see #2059). We've moved it into a new GitHub organization and we need to start from scratch: no past issues, no pending pull requests, etc.

I understand if you are angry or disappointed by this, but we really need to "reset" everything in order to reignite the development of this bundle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants