Results 1 to 10 of 10

Thread: Bug in v3.5.1d: Contact ListView repeated entries

  1. #1
    rbemrose is offline Sugar Community Member
    Join Date
    Jun 2005
    Posts
    169

    Smile (SOLVED) Bug in v3.5.1d: Contact ListView repeated entries

    Hi,

    I would recommend people hold off putting v3.5.1d into production. After upgrading from 3.5.1d from 3.5.1c, the Contact ListView has repeated entries, for example upto 8 entries for a single contact.

    I have repeated the upgrade process and the bug is certainly introduced in 3.5.1d patch

    Bug logged in the new Sugar bug portal:
    http://www.sugarcrm.com/crm/?option=...c-437f78482090

    Regards,
    Rich
    Last edited by rbemrose; 2005-11-20 at 08:31 PM. Reason: Found solution
    Cambridge Online Systems Limited
    http://www.cambridgeonline.net

  2. #2
    kbrill's Avatar
    kbrill is offline SugarCRM PS Engineer
    Join Date
    Jul 2004
    Location
    St Louis, MO
    Posts
    3,183

    Default Re: Bug in v3.5.1d: Contact ListView repeated entries

    Not sure why, I have installed a fresh copy of 3.5.1a and the demo data then applied 3.5.1d and contacts works fine.
    Kenneth Brill - Help Forum Moderator

    I do not respond to 'Private Messages'. Please email me directly instead

    When asking for help, PLEASE give us your Server Information and Version Numbers as asked for on the 'Post New Message' screen as well as any JavaScript errors shown at the bottom of the browser window.
    Help us Help You

  3. #3
    rbemrose is offline Sugar Community Member
    Join Date
    Jun 2005
    Posts
    169

    Default Re: Bug in v3.5.1d: Contact ListView repeated entries

    Thank you for your reply and feedback.

    Can you try a rolling upgrade to 3.5.1d from 3.5.1a through 3.5.1b and 3.5.1c? I was under the impression that the forementioned rolling upgrade was the recommended upgrade path.

    Regards,
    Rich
    Cambridge Online Systems Limited
    http://www.cambridgeonline.net

  4. #4
    kbrill's Avatar
    kbrill is offline SugarCRM PS Engineer
    Join Date
    Jul 2004
    Location
    St Louis, MO
    Posts
    3,183

    Talking Re: Bug in v3.5.1d: Contact ListView repeated entries

    Quote Originally Posted by rbemrose
    Thank you for your reply and feedback.

    Can you try a rolling upgrade to 3.5.1d from 3.5.1a through 3.5.1b and 3.5.1c? I was under the impression that the forementioned rolling upgrade was the recommended upgrade path.

    Regards,
    Rich
    No each upgrade is 'supposed' to be cumulative. However if you apply each one in turn it still seems to work.
    Kenneth Brill - Help Forum Moderator

    I do not respond to 'Private Messages'. Please email me directly instead

    When asking for help, PLEASE give us your Server Information and Version Numbers as asked for on the 'Post New Message' screen as well as any JavaScript errors shown at the bottom of the browser window.
    Help us Help You

  5. #5
    rbemrose is offline Sugar Community Member
    Join Date
    Jun 2005
    Posts
    169

    Default Re: Bug in v3.5.1d: Contact ListView repeated entries

    Hmmm... I wonder what the problem is with my installation

    When I find some time, I will look at the changes between 3.5.1c and patch kit v3.5.1d.

    Thanks for you time and help.

    Regards,
    Rich
    Cambridge Online Systems Limited
    http://www.cambridgeonline.net

  6. #6
    rbemrose is offline Sugar Community Member
    Join Date
    Jun 2005
    Posts
    169

    Thumbs up Re: Bug in v3.5.1d: Contact ListView repeated entries

    SOLVED!

    The problem lies in funtion create_list_query() in file modules/Contact/Contact.php

    Simply insert one line from the previous revision to fix the problem. I have marked the line.

    kbrill: What is the version of this file on your system? And how does this function compare?

    Code:
     
      /* $Id: Contact.php,v 1.180.2.3 2005/11/14 17:48:19 jli Exp $ */
      
      	function create_list_query($order_by, $where, $show_deleted = 0)
       	{
       		$custom_join = $this->custom_fields->getJOIN();
       		$query = "SELECT ";
       		$query .= "
       				$this->table_name.*,
       				accounts.name as account_name,
       				accounts.id as account_id,
       			    users.user_name as assigned_user_name ";
       
       
       
       		if($custom_join){
     				 $query .= $custom_join['select'];
       		 }
       		$query .= "
       				FROM contacts ";
       
       
       
       
       
       		$query .=		"LEFT JOIN users
     				 ON contacts.assigned_user_id=users.id
       				 LEFT JOIN accounts_contacts
     				 ON contacts.id=accounts_contacts.contact_id 
           				    LEFT JOIN accounts
     				 ON accounts_contacts.account_id=accounts.id ";
       
       
       
       		if($custom_join){
     				 $query .= $custom_join['join'];
       		}
       		$where_auto = '1=1';
       		if($show_deleted == 0){
       		    	$where_auto = " $this->table_name.deleted=0 ";
     		 	$where_auto .= " AND (accounts.deleted is NULL or accounts.deleted=0) ";
      // ****** insert the following line ******* /.
     			 $where_auto .= " AND (accounts_contacts.deleted is NULL or accounts_contacts.deleted=0) ";
        		}else if($show_deleted == 1){
     			$where_auto = " $this->table_name.deleted=1 ";	
       		}
       
       		
       				   
       
       		if($where != "")
       			$query .= "where ($where) AND ".$where_auto;
       		else
       			$query .= "where ".$where_auto;
       
       		if(!empty($order_by))
       			$query .= " ORDER BY $order_by";
       		return $query;
       	}
    Regards,
    Rich
    Cambridge Online Systems Limited
    http://www.cambridgeonline.net

  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: Bug in v3.5.1d: Contact ListView repeated entries

    We'll dig into this tomorrow.

    Clint
    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
    jnassi's Avatar
    jnassi is offline Sugar Team Member
    Join Date
    Apr 2005
    Posts
    455

    Default Re: Bug in v3.5.1d: Contact ListView repeated entries

    Hey gang,

    I managed to reproduce what Rich is seeing, and updated the bug he filed accordingly.

    The line in Contact.php that Rich added back was removed due to bug 2761, where the accounts_contacts relationship being deleted resulted in too few results being displayed. Now, Rich ran into the flip side, in bug 2925, where the accounts_contacts relationship being deleted results in too many results being displayed.

    My 2 cents... better to get extra results returned for the moment than too many results returned, so err on the side of leaving the line out of Contact.php (2761) until the queries can be analyzed further and get fixed once and for all in 4.0.

    --Jason Nassi

  9. #9
    kbrill's Avatar
    kbrill is offline SugarCRM PS Engineer
    Join Date
    Jul 2004
    Location
    St Louis, MO
    Posts
    3,183

    Question Re: Bug in v3.5.1d: Contact ListView repeated entries

    Quote Originally Posted by rbemrose
    SOLVED!

    kbrill: What is the version of this file on your system? And how does this function compare?


    Regards,
    Rich
    So what exactly would this bug do. I have a 3.5.1d server that is missing the line indicated, yet I have NO duplicated items.
    Kenneth Brill - Help Forum Moderator

    I do not respond to 'Private Messages'. Please email me directly instead

    When asking for help, PLEASE give us your Server Information and Version Numbers as asked for on the 'Post New Message' screen as well as any JavaScript errors shown at the bottom of the browser window.
    Help us Help You

  10. #10
    rbemrose is offline Sugar Community Member
    Join Date
    Jun 2005
    Posts
    169

    Default Re: Bug in v3.5.1d: Contact ListView repeated entries

    So the source of my problem related to unreferenced contact id's in the table accounts_contacts. I believe this table was tainted by my actions during my initail evaluation of SugarCRM of the Outlook plug-in. The plug-in had a few bugs which deleted contacts while syncing (fixed by Rog of Sugar).

    To clear up the mess, I purged any unreferenced contact id in accounts_contacts with the following:

    mysql> create temporary table idtab SELECT accounts_contacts.id FROM contacts LEFT JOIN users ON contacts.assigned_user_id=users.id LEFT JOIN accounts_contacts ON contacts.id=accounts_contacts.contact_id LEFT JOIN accounts ON accounts_contacts.account_id=accounts.id where contacts.deleted=0 AND (accounts.deleted is NULL or accounts.deleted=0) AND (accounts_contacts.deleted=1);

    mysql> delete from accounts_contacts using idtab,accounts_contacts where accounts_contacts.id = idtab.id;

    I have restored function create_list_query() as per v3.5.1d and the returned ListView contacts is correct.

    What do you think?

    Regards,
    Rich
    Last edited by rbemrose; 2005-11-22 at 04:55 PM.
    Cambridge Online Systems Limited
    http://www.cambridgeonline.net

Thread Information

Users Browsing this Thread

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

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
  •