Project:Addresses
Version:6.x-1.09
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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(

Comments

#1

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.

#2

Status:active» needs review

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

AttachmentSize
addresses_single_line.patch 1.76 KB

#3

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

Let's make the title more appropriate.

#4

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).

#5

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

#6

Status:fixed» closed (fixed)

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

#7

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:

<?php
 
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

#8

Status:active» fixed

Hi Shawn,

Thank you for pointing that out! 8-)

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

Alexis

#9

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:

<?php
 
// 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

#10

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

#11

Status:fixed» closed (fixed)

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