Notice: Undefined index: country in addressfield_format_address_hide_country() (line 21 of sites/all/modules/contrib/addressfield/plugins/format/
Members fund testing for the Drupal project. Drupal Association Learn more


mrfelton’s picture

Status: Active » Needs review
963 bytes
helior’s picture

Status: Needs review » Reviewed & tested by the community

In what scenario/configuration are you encountering this? I suppose someone could create a format plugin to unset the country #options, but they're just asking for trouble ;)

Nonetheless, I can't think of a good reason not to include this.

scalp’s picture

Can confirm that this patch resolves the error. Thank you mrfelton.

zxaos’s picture

I'm seeing this issue when displaying a content type with an addressfield in views, using a views attachment, in HTML List style, displaying a custom display type created with Display Suite. The field's display options are set to "Hide the country when only one is available". In the edit form, the "Address form (country-specific)" setting is also checked.

rszrama’s picture

Status: Reviewed & tested by the community » Fixed

Hah, I finally figured out how to reproduce the notice. These fields must have been configured to not show an address and hide the country. Since they aren't building the format for an address, though, there's no reason to select the box to hide the country. For the folks seeing this notice, you just have a weird configuration. : P

Still, since we don't have plugin dependencies, I'll go ahead and make it conditional.


Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.