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

fix attribute choice value #2679

Merged
merged 1 commit into from
Apr 22, 2015
Merged

Conversation

nicolasricci
Copy link
Contributor

Merge PR #2674 and #2675

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Fixed tickets #2575
Tests pass? yes
License MIT

pjedrzejewski pushed a commit that referenced this pull request Apr 22, 2015
fix attribute choice value
@pjedrzejewski pjedrzejewski merged commit 758c5b7 into Sylius:master Apr 22, 2015
@pjedrzejewski
Copy link
Member

Thank you Nicolas! 👍

@nicolasricci
Copy link
Contributor Author

Thanks for the merge @pjedrzejewski ... but I just realised there is something wrong with my PR.
The attribute getValue now returns the label from the choice options and the BuildAttributeValueFormListener needs to get the raw value to build the select in the backend with the correct option selected.
There are various options I can see to fix this ... the easiest I can think about is passing the raw value to the form builder in https://github.com/Sylius/Sylius/blob/master/src/Sylius/Bundle/AttributeBundle/Form/EventListener/BuildAttributeValueFormListener.php#L95

Let me know what you think about it and I can submit a new PR for it.
Thanks

@nicolasricci
Copy link
Contributor Author

I have created a new PR #2683 so you can check what I had in mind

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

Successfully merging this pull request may close these issues.

2 participants