Results 1 to 8 of 8

Thread: Blank lines in address fields

  1. #1
    bent is offline Senior Member
    Join Date
    Sep 2008
    Posts
    29

    Exclamation Blank lines in address fields

    We have been using Sugar for two years now and have now upgraded from 5.0 to 5.1 on a Debian Etcch LAMP server. After having done so I have noted the following problem:

    Everytime I save the edit views from the leads or contacts module (actually all modules that contain address fields) sugar adds me blank lines to the address_street-fields. That happens everytime I save, having edited the address fields or not.

    This is quite annoying because these empty lines keep appearing in the details views, serial letters etc.

    Has anyone encountered the same problem or a solution?

    Thanks a lot!
    Last edited by bent; 2008-09-03 at 10:59 AM.

  2. #2
    breyton5 is offline Member
    Join Date
    Nov 2007
    Posts
    6

    Default Re: Blank lines in address fields

    Hello!

    I've got the same problem here (with 5.1.0 Build 4732).

    How can I fix this problem?

    Thanks a lot!

  3. #3
    bent is offline Senior Member
    Join Date
    Sep 2008
    Posts
    29

    Default Re: Blank lines in address fields

    Hallo I have not yet encountered the reason for this bevavior nor a solution. However, being two now, may be we can narrow down the problem a bit.

    (1)
    I did an upgrade from 5.0.0f to 5.1 when it happened? How about you?

    (2)
    Have you any hypothesis where it may come from?

  4. #4
    russlevy is offline Junior Member
    Join Date
    Sep 2006
    Posts
    1

    Default Re: Blank lines in address fields

    I have also had the error. I haven't looked at the code yet, but here is an sql statement that will fix it. I have to say though, it's not very good to have to run an SQL statement just to get your data fixed!

    update accounts set shipping_address_street=trim(both '\n' from shipping_address_street),billing_address_street = trim(both '\n' from billing_address_street);

  5. #5
    dlorenzetti's Avatar
    dlorenzetti is offline Sugar Community Member
    Join Date
    Jan 2008
    Location
    São Paulo, Brasil
    Posts
    189

    Default Re: Blank lines in address fields

    Hello All,

    I think It is a bug of Sugar 5.1,

    For address street fields Sugar can have more 3 fields <type>_address_street_2/3/4, so, Sugar call the function "add_address_streets" in SugarBean.php, and if your module have these fields Sugar add a new line and put each address.
    But if not exists these fields Sugar put the blank line.
    For solution that you can fix it directly in /data/SugarBean.php "funtion add_address_streets()"

    for each extra fields (address street 2, 3 and 4) you verify if the field is not empty
    PHP Code:

            
    if ( isset($this->$street_field_2) && !empty($this->$street_field_2)) {
                
    $this->$street_field .= "\n"$this->$street_field_2;
            }

            if ( isset(
    $this->$street_field_3) && !empty($this->$street_field_3)) {
                
    $this->$street_field .= "\n"$this->$street_field_3;
            }

            if ( isset(
    $this->$street_field_4) && !empty($this->$street_field_4)) {
                
    $this->$street_field .= "\n"$this->$street_field_4;
            } 

    I already posted this bug in Sugar Bug.

    I hope this helps.
    Diego Lorenzetti
    Lampada Global Services - Open Source Solutions
    Phone: +55 11 3237-3110
    Email: equipe@lampadaglobal.com
    Site: www.lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

  6. #6
    breyton5 is offline Member
    Join Date
    Nov 2007
    Posts
    6

    Default Re: Blank lines in address fields

    Hello again!

    Thanks for this workaround!

    Changing the method with the further condition fixed the bug

  7. #7
    bent is offline Senior Member
    Join Date
    Sep 2008
    Posts
    29

    Default Re: Blank lines in address fields

    W onderful!
    Thank you - works beautifly again!

    If this is a 5.1 bug I am sure it will be fixed with the next upgrade because this error is quite annoying.

  8. #8
    thowden is offline Sugar Community Member
    Join Date
    Jul 2007
    Posts
    19

    Default Re: Blank lines in address fields

    Another vote of thanks for this fix.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 5
    Last Post: 2008-07-28, 08:12 AM
  2. Auto populate address fields in 4.5
    By joshmark in forum Help
    Replies: 3
    Last Post: 2008-04-18, 11:01 AM
  3. exporting enum custom fields
    By dricrm in forum Developer Help
    Replies: 0
    Last Post: 2007-07-18, 04:41 PM
  4. Replies: 4
    Last Post: 2007-06-12, 10:12 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •