-
-
Notifications
You must be signed in to change notification settings - Fork 96
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 for address fields when value is an associative array of address field keys #236
base: master
Are you sure you want to change the base?
Fix for address fields when value is an associative array of address field keys #236
Conversation
…dress field definition keys.
00d2161
to
441cf6b
Compare
I upgraded from 1.3 to 2.1 yesterday and suddenly all my scenarios that contained steps like this started failing:
(where field_address is a Drupal 8 core Address field) I can't see why AddressHandler is needed. If I delete the AddressHandler.php file, everything works fine. I did try this pull request but it made no difference. |
So there seems to be quite a bit wrong with the existing AddressHandler class:
I agree with @nicrodgers in that it would probably be more ideal to just remove this class as it breaks in the situations I've listed, and it also goes against the address example in the That-said, this class has been out in the wild since So we should probably allow for both cases of keyed and numeric entries, while fixing any of the issues. While the code in this PR does work, it still has the issues:
I have provided the following patch which I believe solves all of these issues, feel free to use this in the PR and make any changes if needed: |
I just tried @mdolnik-eelzee's patch and I can confirm that it does work in my project. @mdolnik-eelzee, would you mind opening a new PR, referencing #206, with your proposed changes? I have a feeling that will have a better chance at getting merged in. |
@chrisolof I created a pull request with the patch provided by @mdolnik-eelzee |
I think we can close this one in favour of #240 everything is linked together so the conversation will not be lost 😃 |
Having the same issue as #206 (Undefined offset 0) when trying to create nodes with address fields. The AddressHandler did expect keyed values matched the keys for the address field definition.
I tried the various formats for address fields listed here, but none of them worked.
This change allows for the following formats: