After much frustration, I've narrowed down a typo in the address module's theme_hook that prevent the single line format from displaying properly.

I'll generate a patch once I clean up my files. Around line 300:

    // Shows addresses using a single line
    'addresses_address_singleline' => array(

should be:

    // Shows addresses using a single line
    'addresses_singleline' => array(
CommentFileSizeAuthor
#2 addresses_single_line.patch1.76 KBJamesAn
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

JamesAn’s picture

One more area that needs to be modified so that addresses_cck can do single line display. Uncomment lines 75 to 80:

//     'single_line' => array(
//       'label'           => t('Single Line'),
//       'arguments'       => array('element'),
//       'multiple values' => CONTENT_HANDLE_CORE,
//       'field types'     => array('addresses_cck'),
//     ),

becomes

    'single_line' => array(
      'label'           => t('Single Line'),
      'arguments'       => array('element'),
      'multiple values' => CONTENT_HANDLE_CORE,
      'field types'     => array('addresses_cck'),
    ),

I'll roll these two changes into a patch for the 1.05 version.

JamesAn’s picture

Status: Active » Needs review
FileSize
1.76 KB

Here's the two changes to re-enable the single line formatter.

JamesAn’s picture

Title: Address singleline theme function misspelled » Enabling Single Line Formatter

Let's make the title more appropriate.

kdebaas’s picture

Status: Needs review » Needs work

In the single line formatter display, the country field is returned as two-letter code, and the additional field is missing. It also does not respect field order (although the ability to set field order is a bit buggy still anyway).

AlexisWilke’s picture

Status: Needs work » Fixed

This is fixed in the development version (6.x-1.x-dev). I'm not too sure why it takes so long to fix such small errors, do you?! 8-)

It will be in the next major version (1.09).

Thank you.
Alexis

Status: Fixed » Closed (fixed)

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

sdsheridan’s picture

Version: 6.x-1.05 » 6.x-1.09
Status: Closed (fixed) » Active

Actually, I think the error was in the addresses_cck.inc file, which is still there in 6.x-1.09. The function theme_addresses_cck_formatter_single_line return line should have read:

  return theme('addresses_address_singleline', $element['#item']);

instead of what it was, which was the first argument just being addresses_singleline. Clearing the theme registry cache after making this change now shows my CCK single-line addresses, albeit with lower-case country-codes as opposed to the actual country. Hmmmm... may have to patch that...

Shawn

AlexisWilke’s picture

Status: Active » Fixed

Hi Shawn,

Thank you for pointing that out! 8-)

I checked in the fix. It will be in 1.10.

Alexis

sdsheridan’s picture

No problem. :-) Incidentally, I did patch it to print out the country name (just used a call to theme_addresses_country in function theme_addresses_address_singleline) for the single line address, as it looks better IMHO, especially mixing Canadian province codes and the country name. Might be good to make this an option if the lower-case two-letter country code is still required for some reason in a single-line address. The last bit of the function theme_addresses_address_singleline post-patch looks like:

  // Add the country
  if (!empty($afields['country'])) {
    $output .= ' . '. theme_addresses_country($afields);
  }

  return $output;

whereas the assignment was just $output .= ' '. $afields['country']; before.

Incidentally, I'm using a couple of other feature patches, namely those from Customization of field titles and help text and Patch to allow designation of "top countries". Will those make it into 6.x-1.10 too?

Thx, Shawn

AlexisWilke’s picture

You may want to give a try to version 6.x-1.x to see how all those things work for you.

On my end, somehow, the CCK fields do not work at all... (they don't appear in the form.) Maybe that's specific to the newest version although I did not really make much changes to the CCK area.

Thank you.
Alexis

Status: Fixed » Closed (fixed)

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