Here's a 'bug' I don't think many outside of Australia will have come across. In both billing and shipping the Address 2 field label is missing and the text field has shifted to the left. When I inspect the page I can see the Address 2 label is not there. I flushed all the caches to no avail and finally reinstalled 2.23, but the problem persists. I don't think it will break anything but it just looks ugly.

I think this may be the code responsible.

\profiles\commerce_kickstart\modules\contrib\addressfield\plugins\format\address.inc (line143)

// Country-specific customizations.
if (in_array($address['country'], array('AU', 'EE', 'LT', 'LV', 'NZ', 'RU'))) {
// These countries don't use the "Address 2" line.
// Leave it as a precaution, but hide the label to avoid confusing users.
$format['street_block']['thoroughfare']['#title'] = t('Address');
$format['street_block']['premise']['#title_display'] = 'invisible';
}

When I remove 'AU' the label returns and the field is justified. But I don't like hacking code so is there another way I can fix this?

Thanks.

Comments

bojanz’s picture

Category: Bug report » Support request
Status: Active » Fixed

This was intentionally implemented for Australia, with oversight from Australian community members and the AusPost website as an example.

Here's the relevant addressfield issue: #1713698: Correct address labels for Australia.

You can try to implement a hook_field_widget_alter() or an addressfield plugin, but I'd advise to leave it as-is.

agroo’s picture

Ok thanks bojanz. I think I will just leave as is but with the label restored as per my post. Seems to be ok.

Status: Fixed » Closed (fixed)

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