Results 1 to 8 of 8

Thread: Import fails with apostrophe in Account Name

  1. #1
    hkphooey is offline Sugar Community Member
    Join Date
    Jan 2007
    Posts
    94

    Default Import fails with apostrophe in Account Name

    I just re-opened an old bug on this subject, but thought I'd mention it here as it might help someone out.

    I was just trying to import a CSV file into the contacts module of 5.0.0c. The import stalled (dots stopped appearing across the screen, and I wasn't taken to the Import Successful screen.

    I popped open a new window and saw that only 807 of my 1500 contacts had been imported. Looking at the CSV file, I could see that line 808 contained an Account name with an apostrophe.

    I removed the apostrophe and was able to import the remainder of the file ... until it found another Account name with an apostrophe in it.

    This is a pretty basic bug which was apparently fixed in version 4.2, but has resurfaced a couple of years on. Hope this helps someone and saves them some frustration.

    Bug Report
    ============
    Bug Number: 4846
    Subject:: Import Contacts
    Type:: Defect
    Status: Pending
    Sugar Edition:: open_source
    Product Category:: Import
    Found In Release:: 4.0.1c
    Targeted Release:: 5.1.0
    Priority:: Medium
    Resolution: Fixed
    Date Entered: 2006-02-27 04:45:29 (GMT)
    Date Modified: 2008-02-27 19:10:23 (GMT)
    Description:: Try to import a csv file with a compnay name that has an apostrophe in it as in Sportsman's Market and you get an error

  2. #2
    clint's Avatar
    clint is offline Sugar Team Member | Forums Lead Moderator
    Join Date
    Aug 2004
    Location
    Silicon Valley
    Posts
    2,120

    Default Re: Import fails with apostrophe in Account Name

    Are you doing duplicate checks while importing? I found a bug with duplicate checking when there is an apostrophe, but haven't seen the issue when no dup checking takes place.
    Sugar Developer Zone - developer resources | Sugar University - user and admin training
    Sugar Docs - user and admin documentation |
    Sugar Bug Tracker - Enter or view bugs
    SugarForge- open source modules, themes, lang packs | SugarExchange - commercial extensions

    Clint Oram
    Chief Technology Officer and Co-founder
    SugarCRM

  3. #3
    clint's Avatar
    clint is offline Sugar Team Member | Forums Lead Moderator
    Join Date
    Aug 2004
    Location
    Silicon Valley
    Posts
    2,120

    Default Re: Import fails with apostrophe in Account Name

    Bug 21693 tracks the issue with dup checking on import incorrectly flagging fields with apostrophes as duplicates. The bug report also contains the fix.
    Sugar Developer Zone - developer resources | Sugar University - user and admin training
    Sugar Docs - user and admin documentation |
    Sugar Bug Tracker - Enter or view bugs
    SugarForge- open source modules, themes, lang packs | SugarExchange - commercial extensions

    Clint Oram
    Chief Technology Officer and Co-founder
    SugarCRM

  4. #4
    benk is offline Sugar Community Member
    Join Date
    Apr 2006
    Posts
    12

    Default Re: Import fails with apostrophe in Account Name

    I am experiencing the same "apostrophe in Account Name" problem even when not checking for duplicates. So it appears the bug fix mentioned above may not address the total problem. I am using the latest SugarCRM release and patch, version 5.0.0e.

    So as of today (May 22, 2008), it appears that this problem persists.

    Thanks,
    Ben

  5. #5
    clint's Avatar
    clint is offline Sugar Team Member | Forums Lead Moderator
    Join Date
    Aug 2004
    Location
    Silicon Valley
    Posts
    2,120

    Default Re: Import fails with apostrophe in Account Name

    Quote Originally Posted by benk
    I am experiencing the same "apostrophe in Account Name" problem even when not checking for duplicates. So it appears the bug fix mentioned above may not address the total problem. I am using the latest SugarCRM release and patch, version 5.0.0e.

    So as of today (May 22, 2008), it appears that this problem persists.

    Thanks,
    Ben
    It appears that the bug is slated to be fixed in 5.1.0. The fix is listed in the bug report, so you can apply it yourself to your 5.0.0 system.
    Sugar Developer Zone - developer resources | Sugar University - user and admin training
    Sugar Docs - user and admin documentation |
    Sugar Bug Tracker - Enter or view bugs
    SugarForge- open source modules, themes, lang packs | SugarExchange - commercial extensions

    Clint Oram
    Chief Technology Officer and Co-founder
    SugarCRM

  6. #6
    forrest is offline Junior Member
    Join Date
    May 2008
    Posts
    3

    Default Re: Import fails with apostrophe in Account Name

    Is there a different bug for the non-dupe case, because I had to fix it in a different place:

    .../modules/Import
    $ diff ImportStep4.php*
    321,322c321
    < $quotedfield = PearDatabase::quote($focus->$field);
    < $query = "SELECT id FROM {$defintion['table']} WHERE {$defintion['rname']} = '{$quotedfield}'";
    ---
    > $query = "SELECT id FROM {$defintion['table']} WHERE {$defintion['rname']} = '{$focus->$field}'";


    Guess as to how it snuck back in: QA does not use single quotes in their test cases.

  7. #7
    clint's Avatar
    clint is offline Sugar Team Member | Forums Lead Moderator
    Join Date
    Aug 2004
    Location
    Silicon Valley
    Posts
    2,120

    Default Re: Import fails with apostrophe in Account Name

    Quote Originally Posted by forrest
    Is there a different bug for the non-dupe case, because I had to fix it in a different place:

    .../modules/Import
    $ diff ImportStep4.php*
    321,322c321
    < $quotedfield = PearDatabase::quote($focus->$field);
    < $query = "SELECT id FROM {$defintion['table']} WHERE {$defintion['rname']} = '{$quotedfield}'";
    ---
    > $query = "SELECT id FROM {$defintion['table']} WHERE {$defintion['rname']} = '{$focus->$field}'";


    Guess as to how it snuck back in: QA does not use single quotes in their test cases.
    Good catch. Will add this to the bug report.

    Just to clarify, this would come into play when importing contacts and the corresponding account name has an apostrophe in it's name. Is this the use case you ran into?
    Last edited by clint; 2008-05-30 at 12:41 PM.
    Sugar Developer Zone - developer resources | Sugar University - user and admin training
    Sugar Docs - user and admin documentation |
    Sugar Bug Tracker - Enter or view bugs
    SugarForge- open source modules, themes, lang packs | SugarExchange - commercial extensions

    Clint Oram
    Chief Technology Officer and Co-founder
    SugarCRM

  8. #8
    forrest is offline Junior Member
    Join Date
    May 2008
    Posts
    3

    Default Re: Import fails with apostrophe in Account Name

    Yes, that's correct, the apostrophe had to be in the Account Name column of a Contact being imported.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 2007-06-21, 10:45 AM
  2. Replies: 0
    Last Post: 2006-08-28, 01:27 PM
  3. Replies: 4
    Last Post: 2006-07-05, 11:39 AM
  4. Import contact on existing account
    By esolarc in forum Developer Help
    Replies: 1
    Last Post: 2006-03-22, 01:21 PM
  5. Replies: 1
    Last Post: 2005-12-24, 09:38 AM

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
  •