CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • A space in the begining of the addressee name
Pages: [1]

Author Topic: A space in the begining of the addressee name  (Read 891 times)

pkeogan

  • I post frequently
  • ***
  • Posts: 130
  • Karma: 4
    • BackOffice Thinking
A space in the begining of the addressee name
August 24, 2010, 08:41:28 pm
When generating labels for individuals I'm using the standard addressee tokens:
{contact.individual_prefix}{ }{contact.first_name}{ }{contact.middle_name}{ }{contact.last_name}{ }{contact.individual_suffix}

If a contact record does not have a prefix, then the label begins with a space. 

This sorta makes sense because there is space between the prefix and the first name.  (I believe there is also a double space between first and last name if not middle name exists) 

But, non of the civi installs behave the same way.  For all the other installations I've done, if the contact doesn't have a prefix and the first name starts at the begining of the line without a beginnig space.

Any ideas why this is happening?


obiuquido144

  • I post occasionally
  • **
  • Posts: 34
  • Karma: 4
Re: A space in the begining of the addressee name
August 25, 2010, 03:17:39 am
We're experiencing this problem too, on 3.1.4.
Yesterday I saw that there was a workaround added later on to the label generator that trims whitespace at the beginning and end of the addressee field. I think the underlying cause wasn't fixed though - I think there's still excessive whitespace in the civicrm_contact table, not 100% sure though.

Our workaround is to change the addressee token to display_name and run the update script
http://<sitename>/sites/all/modules/civicrm/bin/UpdateGreeting.php?ct=Individual&force=1&gt=addressee&name=<user>&pass=<pass>&key=<key>
(Update 3: you first need to go to sites/all/modules/civicrm/bin/ and rename UpdateGreeting.php.txt to just .php otherwise the link will just take you to the homepage. For us the script outputs quite a lot of warnings/errors but nothing to worry about.)


Interesting is that by default, the token contains 1 white space that probably shouldn't be there:
{contact.individual_prefix}{ } {contact.first_name}, maybe it's related to the issue.


update: FYI, when we edit a contact in 3.1.4 that has the addresse field OK (contact was added in earlier version), the addressee field becomes broken on saving the contact - whitespace is added.

update 2: The current version (3.2.2) on the demo is broken too in the way that if there's no middle name, there are two spaces between the first and last name instead of just one. Look e.g. at the addressee field of http://drupal.demo.civicrm.org/civicrm/contact/view?reset=1&cid=138 in Firebug.
So there's definitely an issue...
« Last Edit: August 25, 2010, 05:08:41 am by obiuquido144 »

pkeogan

  • I post frequently
  • ***
  • Posts: 130
  • Karma: 4
    • BackOffice Thinking
Re: A space in the begining of the addressee name
August 25, 2010, 05:45:34 am
Thanks.  We have tried similar fixes and haven't been able to permenently fix the issue, but I do agree with your approach.  I think we're just going to upgrade to 3.2.1.  I'll report back....

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • A space in the begining of the addressee name

This forum was archived on 2017-11-26.