Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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(
Comment | File | Size | Author |
---|---|---|---|
#2 | addresses_single_line.patch | 1.76 KB | JamesAn |
Comments
Comment #1
JamesAn CreditAttribution: JamesAn commentedOne more area that needs to be modified so that addresses_cck can do single line display. Uncomment lines 75 to 80:
becomes
I'll roll these two changes into a patch for the 1.05 version.
Comment #2
JamesAn CreditAttribution: JamesAn commentedHere's the two changes to re-enable the single line formatter.
Comment #3
JamesAn CreditAttribution: JamesAn commentedLet's make the title more appropriate.
Comment #4
kdebaas CreditAttribution: kdebaas commentedIn 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).
Comment #5
AlexisWilke CreditAttribution: AlexisWilke commentedThis 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
Comment #7
sdsheridanActually, 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:
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
Comment #8
AlexisWilke CreditAttribution: AlexisWilke commentedHi Shawn,
Thank you for pointing that out! 8-)
I checked in the fix. It will be in 1.10.
Alexis
Comment #9
sdsheridanNo 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:
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
Comment #10
AlexisWilke CreditAttribution: AlexisWilke commentedYou 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