Results 1 to 2 of 2

Thread: 5.1 Contacts export file shows email1 column twice but with invalid data.

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

    Default 5.1 Contacts export file shows email1 column twice but with invalid data.

    Hi

    Using the contacts Export option to generate a .csv file gives a column called email1 twice. The second column showing with the account_name values not an email address.

    modules\contact\contacts.php has a query around line 339.

    PHP Code:
    $query "SELECT 
                   contacts.*,email_addresses.email_address email1, 
                   accounts.name as account_name, 
                   users.user_name as assigned_user_name "

    The issue comes from having an upgraded database where the contacts table has a deprecated email1 column while the 5.1 code is trying to alias the email_addresses table column email_address as email1. Either remove the two deprecated contacts table columns email1 & email2 or modify the above query to

    PHP Code:
    $query "SELECT 
                            contacts.*, 
                            email_addresses.email_address as email_address, 
                            accounts.name as account_name, 
                            users.user_name as assigned_user_name "

    Which changes the alias for the column, stops the clash with the old column, and adds in the missing SQL 'as" as a formality.

    Hope this helps someone who is upgrading from earlier versions to 5.1 and using the contact / accounts export.

    cheers
    Tony

    Marble Bay Pty Ltd
    Wren/Maxwell Web Management
    Last edited by thowden; 2008-09-26 at 03:36 AM.

  2. #2
    roblaus's Avatar
    roblaus is offline Sugar Community Member
    Join Date
    Dec 2006
    Location
    Vienna / Austria
    Posts
    2,850

    Default Re: 5.1 Contacts export file shows email1 column twice but with invalid data.

    Great, thanks.
    Would you mind filing a bug so that your fix really makes it into one of the next patches? http://bugs.sugarcrm.com

    rgds
    __________________________
    Robert Laussegger
    http://www.iscongroup.net

    Bei Fragen: support@iscon.at
    Die deutschen Sprachdateien für SugarCRM und das deutsche Handbuch gibt es hier: http://goo.gl/kPsAz
    Ab sofort auch mit 6.4.2

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. HELP - Act import (field mapping)
    By smelamed in forum Help
    Replies: 32
    Last Post: 2010-12-15, 05:39 PM
  2. Replies: 5
    Last Post: 2007-11-13, 02:51 PM
  3. Data Migration from ACT! 2005 to SugarCRM
    By gquick in forum Classifieds
    Replies: 7
    Last Post: 2007-05-02, 05:54 PM
  4. Replies: 1
    Last Post: 2006-09-11, 03:38 PM
  5. SugarCrm 4.0 Patch
    By mgamboa in forum General Discussion
    Replies: 0
    Last Post: 2005-12-21, 04:14 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
  •