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

Rewrite the symfony/form integration #66

Open
bojanz opened this issue Sep 23, 2016 · 8 comments
Open

Rewrite the symfony/form integration #66

bojanz opened this issue Sep 23, 2016 · 8 comments

Comments

@bojanz
Copy link
Contributor

bojanz commented Sep 23, 2016

The old integration was removed in 8b770ff.
Needs to be updated for the new subdivision storage, and for Symfony 3.0.
Also needs to be finished, in regards to AJAX.

The Drupal form implementation is a good one to investigate, but it won't be a 1-1 mapping cause symfony/form is a lot less flexible.

@abdfork
Copy link

abdfork commented Sep 26, 2016

I'm working on a PR for this, using symfony forms

abdfork added a commit to abdfork/addressing that referenced this issue Sep 30, 2016
@abdfork
Copy link

abdfork commented Oct 1, 2016

I have added support for Symfony Forms, it can use a custom translator and also, if installed, it uses symfony/translation to translate the labels of the form.

I have one problem though, Address doesn't have setters using the standard set* functions, so the Symfony property accessor used by Symfony fails. I have arguably added a magic setter here as a workaround but maybe we should add the proper setters to Address or we could leave it alone and not use a data_class in AddressType to prevent more coupling with Symfony.

Have a look at 78c70fd and we can discuss further or if you're happy with it I can prepare a PR.

I think I will also be working on a Symfony Bundle using Addressing

@bojanz
Copy link
Contributor Author

bojanz commented Oct 1, 2016

Great! I'm out of town so I won't be able to look at the code for another day or two.

For the Address setter problem you want to define a custom data mapper, as described here: https://webmozart.io/blog/2015/09/09/value-objects-in-symfony-forms/
That way we keep the current value object semantics of the Address object.

@abdfork
Copy link

abdfork commented Oct 10, 2016

Sorry for the radio silence.

I though of that, but I don't like using a custom mapper if the entity has it's own setters and getters, specially when we have trouble just with the setters.
In the end, I've created a custom propertyAccessor to use with*() here 58859f0

Let me know your thoughts.

@leevigraham
Copy link
Contributor

Any update on the PR?

@bojanz
Copy link
Contributor Author

bojanz commented Apr 19, 2017

@abdfork Sorry, I've definitely been the bottleneck for this issue. A big reason for that is because I personally don't use Symfony (Forms). Thinking about it some more, I definitely think that the form integration should live in the Symfony Bundle (which registers our repositories and formatters in the container, provides the form bits, etc). Would you be willing to create and maintain one? I could then link it from the README here.

Pointing #44 to this issue, since it was about the old form integration's inability to have translated labels. Also pointing #55, which has a reasonable feature request (allow to choose which address fields will be rendered).

@Pierrmouth
Copy link

Hey there
Is there someone maintaining this part ? Couldn't find any other addresses bundle fine enough and I'm not able to make one by myself ...

@bojanz
Copy link
Contributor Author

bojanz commented Sep 12, 2020

Looks like the bundle to follow is https://github.com/daften/addressing-bundle

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

No branches or pull requests

4 participants