Problem/Motivation

The last address component separator (e.g. comma) is visible.

Company Street 1 City, 30-000 Poland Jan Nowak,

Proposed resolution

Hide the separator for the last component.

Comments

Krzysztof Domański created an issue. See original summary.

lamp5’s picture

Good point @Krzysztof Domański. Could you provide the solution??

khusingh’s picture

StatusFileSize
new24.87 KB

This is not a bug. Module is already providing feature to add / remove comma separator.
Steps :

  1. Go to the Manage display tab
  2. Click on Address settings icon
  3. Update the Glue as per the requirement and Click on "UPDATE" button to save the settings

Please refer attachment add_remove_glue for more clarification.

krzysztof domański’s picture

Version: 8.x-1.0-beta2 » 8.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new4.77 KB
new6 KB

@khusingh Thanks for your help in this issue.

This is a bug when we need a separator before the last optional element.

I want a comma between family_name and organization.
address_line1 locality, Poland given_name family_name, organization

I want organization to be optional.
address_line1 locality, Poland given_name family_name,

I want to hide the separator if the optional element is empty.
address_line1 locality, Poland given_name family_name

krzysztof domański’s picture

StatusFileSize
new1.75 KB
new6.63 KB

Delete duplicate condition, because it was used elsewhere.

     foreach ($config_exclude_hidden as $key => $config_item) {
-      if ($config_item['display'] && !empty($item[$key])) {
// Skip hidden or empty items.
$config_exclude_hidden = [];
foreach ($config as $key => $config_item) {
  if ($config_item['display'] && !empty($item[$key])) {
    $config_exclude_hidden[$key] = $config_item;
  }
}

lamp5’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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