Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have attached screenshots to help illustrate this issue. If you add more than one address field on a single form the 'Used field' settings are not respected for the second field. You can see on the screenshot that I have added two address fields. The first one only allows for selection of a country. The second allows for a complete address. On the actual form, though, both fields only allow for the country to be input.
Comment | File | Size | Author |
---|---|---|---|
Screen Shot 2017-01-23 at 16.14.56.png | 77.92 KB | bletch | |
Screen Shot 2017-01-23 at 16.14.42.png | 84.2 KB | bletch | |
Screen Shot 2017-01-23 at 16.14.26.png | 92.04 KB | bletch |
Comments
Comment #2
bletch CreditAttribution: bletch as a volunteer commentedJust to clarify, this problem persists once a country is selected. The screenshots were taken without the selection.
Comment #3
dwwI tried it with 2 address fields on the same entity bundle, the first collecting just country and administrative area, the 2nd collecting everything but names.
It indeed appears to be broken in 8.x-1.0-rc3. I can select a country in the first field, and the appropriate administrative area appears. However, any changes to the 2nd field's country are causing the AJAX callback to fail, so no form elements for the subfields are inserted.
After upgrading to the end of the 8.x-1.x branch (currently @ commit bca416ec) and it all works fine. So one of the commits between 2722646..bca416ec has already fixed this bug. Not sure it's worth investigating further, other than confirmation that upgrading to the latest 8.x-1.x-dev resolves the bug for you, too. If not, please reopen this issue.
Thanks,
-Derek
Comment #4
dwwLooking briefly at the git log and the error I saw when I tested this, it's now obvious that #2619878: Recoverable fatal error: Argument 1 passed to Drupal\\Core\\Form\\ FormState::setError() must be of the type array is the issue where this bug was fixed.
Cheers,
-Derek
Comment #5
bletch CreditAttribution: bletch as a volunteer commentedCool, thanks for looking into this. I will make sure to update.