Closed (fixed)
Project:
Location
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
19 Sep 2008 at 18:13 UTC
Updated:
27 May 2010 at 13:55 UTC
Jump to comment: Most recent file
Comments
Comment #1
yesct commentedCould some confirm this extra comma is still in the latest dev versions?
And if it is, making a patch would really help to evaluate/get this committed. To make a patch, you make a copy of the file (or directory structure) then make changes in one (or more) of the files, and then run diff on the two files, the output of diff is the patch... here is a better description of how to make a patch: http://drupal.org/patch/create
I'll mark this postponed, needs more info, for now.
Comment #2
tonycpsu commentedThe extra comma is still there in 6.x-3.x-dev. Here's a patch.
Comment #3
yesct commentedcould someone try this patch on their 6.x-3.x-dev version. if this works, please change the status to RTBC, reviewed and tested by the community. does this patch also apply to the 5.x branch? someone could try that too.
Comment #4
tonycpsu commentedI have not tried it on 5.x, as I only have 6.x available now.
Comment #5
axolx commentedThis is a tpl file. You can override it in your theme. Just clone location.tpl.php to your theme's dir, make the desired changes, and clear the cache to that the new template file makes it to the theme registry.
Comment #6
mrtoner commentedTested on dev. BTW, Addresses has a nifty address formats feature that, along with Token, allows you to define how addresses should display for various countries.
Comment #7
jonathan_hunt commentedThe patch in #2 will leave a dangling comma if $city exists but none of $province or $postal_code. I'm using the following right now:
Comment #8
yesct commentedneeds #7 to be rolled as a patch.
Comment #9
yesct commentedthere is a good chance of getting some things committed, if a patch can be re-rolled to match the new 6.x-dev version (http://drupal.org/project/location)
Comment #10
mikeytown2 commented#7 as a patch
Comment #11
SeanA commentedHere's what I'm using, it's a bit more efficient and understandable IMO. Applies to both 6.x-dev and 5.x-dev.
Comment #12
yesct commentedtagging
Comment #13
yesct commentedreviewing
current behavior:
city, zip
zip
state, zip
state
city, state
city, state, zip
city
after patching:
city zip
zip
state zip
state
city, state
city, state zip
city
sooo the only change is
city, zip -> city zip
state, zip -> state zip
city, state, zip -> city state zip
I think most can agree
city, state, zip -> city state zip
is the improvement looked for
and
state, zip -> state zip
is probably wanted too
I think it is questionable what to do about
city zip
should be OK
fwiw, the us post office asks for NO commas in the city state zip string when writing address on an envelope...
I re-rolled #11 to take out an extra space.
diff between my patch and #11
taking a look at using token as mentioned in #6 might be good in the future
Comment #14
hutch commentedMake it print
$province_nameinstead of$provinceand you fix two bugs in one.Comment #15
SeanA commentedThat extra space is needed or there'll be no space preceding the zip code and you'll get:
123 Street Road
Townsville, NY12345
instead of:
123 Street Road
Townsville, NY 12345
Comment #16
yesct commentedI dont think so...
with the patch I tested it to get
http://location.yestande.com/node/4
here are more various tests:
http://location.yestande.com/node/16
http://location.yestande.com/node/15
http://location.yestande.com/node/14
http://location.yestande.com/node/13
http://location.yestande.com/node/12
http://location.yestande.com/node/11
http://location.yestande.com/node/10
http://location.yestande.com/node/2
http://location.yestande.com/node/3
If you look at the code, there is a space after the comma after the city:
and after the end span in the province/state:
Comment #17
SeanA commentedYou're right... except for the case where we have just the city and zip, with no state/province. As can be seen in your example:
http://location.yestande.com/node/12
Comment #18
yesct commentedOh, totally good catch! How did I miss that!?
that makes the patch in #11 the one to use! (with the "extra" space, which is not really extra after all).
Comment #19
SeanA commentedNew patch that outputs the full province name instead of the internal code. (see #115323: State/province names should be displayed (during output/views) instead of codes). Otherwise the same as #11.
Comment #20
yesct commentedSeanA thanks, but I think putting two issues in one patch makes it hard for the maintainers to commit things, and mark in the changelog what has changed... I think.
Note, the patch to commit is the one in #11
Comment #21
hutch commentedThere are indeed two separate issues here.
1) Showing province versus province_name. The US folks don't mind the code as it is commonly used but it confounds other countries. Perhaps this should be an option under admin/settings....
2) Commas. A matter of taste really, I personally would like to see the
$city_province_postalarray removed altogether and the individual fields just printed out with no commas at all. This is a template after all and should just provide a basis for themers to work on.These are policy decisions IMHO.
Comment #22
yesct commentedI agree, there is a need to make it more generic so it can be themed as individual site desire, but I think first, there IS a bug to fix here, with the double comma. Lets get that small fix in, then tackle a more ideal way. :)
Comment #23
hutch commentedOK, patch in #11 it is, patches cleanly.
Comment #24
rooby commentedCommitted #11 to D6 and HEAD with a minor coding standards fix of adding braces to the single line if statement.
I also ported and committed to D5.
Comment #25
yesct commentedhttp://drupal.org/cvs?commit=360992
http://drupal.org/cvs?commit=360994
http://drupal.org/cvs?commit=360996
Comment #27
rooby commentedJust realised I committed to the DRUPAL-5 branch instead of the DRUPAL-5--3 branch :(
Committed to DRUPAL-5--3 - http://drupal.org/cvs?commit=372114