AnsweredAssumed Answered

contacts_following preventing me from deleting Contact

Question asked by Francesca Shiekh on Jan 4, 2016
Latest reply on May 8, 2017 by Soon Van

When trying to delete a Contact (any Contact) I get a 500 error.

The SugarCRM Log shows:


Mon Jan  4 14:49:05 2016 [7515][2053ed63-d2dc-52e8-0049-4ddab9fc33f1][FATAL] could not load RHS


The PHP Log reports:


PHP Fatal error:  Call to a member function removeAll() on a non-object in /var/www/html/env2/sugarcrm/data/Link2.php on line 627, referer:


I believe I tracked this down to a missing rhs link in the remove function for the relationship contacts_following

in data/Relationships/M2MRelationship.php


function remove($lhs, $rhs)

is trying to set

        $lhsLinkName = $this->lhsLink;

        $rhsLinkName = $this->rhsLink;

but failing.


Where $this is the following object


UserBasedRelationship Object


    [type] => user-based

    [def:protected] => Array


            [name] => contacts_following

            [lhs_module] => Contacts

            [lhs_table] => contacts

            [lhs_key] => id

            [rhs_module] => Users

            [rhs_table] => users

            [rhs_key] => id

            [relationship_type] => user-based

            [join_table] => subscriptions

            [join_key_lhs] => parent_id

            [join_key_rhs] => created_by

            [relationship_role_column] => parent_type

            [relationship_role_column_value] => Contacts

            [user_field] => created_by



    [lhsLink:protected] => following_link

    [rhsLink:protected] =>

    [ignore_role_filter:protected] =>

    [self_referencing:protected] =>

    [userField] => created_by

    [name] => contacts_following

    [lhsLinkDef] => Array


            [name] => following_link

            [type] => link

            [relationship] => contacts_following

            [source] => non-db

            [vname] => LBL_FOLLOWING



    [rhsLinkDef] =>



Note that the rhsLink is blank.

I don't believe we've done anything to manipulate this relationship at all.

Is anyone else seeing a problem? Any thoughts on how to further debug?