[Address 8.x-1.x] Allow to set a list of preferred countries on address field

Created on 28 November 2019, over 4 years ago
Updated 8 April 2024, 3 months ago

When adding an address field to a webform we can't specify priority countries. There is current work that is being done to make this a possibility for the Address module in general, but it causes an error when we add an address field to a webform and doesn't give us any control over it within the webform.

Steps to Repeat:
1. Apply patch from https://www.drupal.org/project/address/issues/2626982 ✨ Allow to set a list of preferred countries RTBC to the Address module
2. Add an address field to a webform
3. View the webform and see this error message: "Notice: Undefined index: #preferred_countries in Drupal\address\Element\Address::processAddress() (line 195 of modules/contrib/address/src/Element/Address.php)."

I'm going to work on combining the new functionality from the Address module with the Webform module.

✨ Feature request
Status

Postponed

Version

6.2

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada ericawright

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡©πŸ‡ͺGermany markdc Hamburg

    #4 applies to Address 8.x-1.11 but I'm having trouble.

    The Basic Address field shows no limitation options.
    The Advanced Address field does. However trying to save the field results in this error:

    Warning: Undefined array key "#preferred_countries" in _webform_entity_element_validate_rendering_error_handler() (line 1076 of /var/www/vhosts/quadroworld.com/drupal_stage/web/modules/contrib/webform/webform.module)

  • πŸ‡¬πŸ‡§United Kingdom dahousecat

    Passing the preferredCountries to intlTelInput only works if countrySearch is turned off.
    This is documented on this page under the preferredCountries section.

    This is a simple 1 line change in js/webform.element.telephone.js to disable countrySearch when preferred countries are set.

    I've attached a patch which is against 6.1.x.

  • πŸ‡¨πŸ‡¦Canada Liam Morland Ontario, CA πŸ‡¨πŸ‡¦

    6.1.x is not supported. Is this still an issue on 6.2.x? If so, the patch needs to be against that branch.

  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY
Production build 0.69.0 2024