After creating a new event in a fresh test Drupal Commons site the address field content (postal_address) is not rendered in the node view. Data is saved in the database. As far as I can see using the devel module data is available. I am testing with admin/full rights. Tried to re-install. Tried to add a new address_field and this one does also not render. Is there anything else to verify/check?

Comments

bart.roelands@gmail.com’s picture

Hello,

I found out today that the address is not displaying because of a check in the commons origin template.php line 1172

/**
 * Overrides theme_field__addressfield().
 */
function commons_origins_field__addressfield($variables) {
  $output = '';

  // Add Microformat classes to each address.
  foreach($variables['items'] as &$address) {
    // Only display an address if it has been populated. We determine this by
    // validating that the administrative area has been populated.
    if (!empty($address['#address']['administrative_area'])) {
      _commons_origins_format_address($address);
    }
    else {
      // Deny access to incomplete addresses.
      $address['#access'] = FALSE;
    }
  }

For address formats that don't have a administrative_area (such as in my case Belgium) this field remains empty end is thus not displayed.

I have worked around this for now changing line 1187 to

$address['#access'] = TRUE;

There is probably a better fix for future releases.

Thank you for taking this up

Bart