Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-8448

Creating a second relationship generates a notice and a warning about non initialized var relTypeIds

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.4.4, 4.0.4
    • Fix Version/s: 3.4.5, 4.0.5
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      I can't reproduce this problem with all my contacts, but only with some of them.
      I'm editing a contact, adding a second employee of relationship, and when I validate I obtain :
      Notice : Undefined variable: relTypeIds dans CRM_Contact_BAO_Relationship::relatedMemberships() (ligne 1173 dans /var/www/drupal/sites/all/modules/civicrm/CRM/Contact/BAO/Relationship.php).
      Warning : Invalid argument supplied for foreach() dans CRM_Contact_BAO_Relationship::relatedMemberships() (ligne 1173 dans /var/www/drupal/sites/all/modules/civicrm/CRM/Contact/BAO/Relationship.php).

      Any case, there's a problem with the fact that relTypeIds is used while we're not sure it's initialized.
      Not diving deep into the code, I'd propose adding a simple :
      $relTypeIds = array( );
      line 1131 of the civicrm/CRM/Contact/BAO/Relationship.php file (correct the problem).

      Note : it's a non blocking bug

        Attachments

          Activity

            People

            • Assignee:
              rohan Rohan S. Chavan
              Reporter:
              tonthon tonthon
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 15 minutes
                15m
                Remaining:
                Remaining Estimate - 15 minutes
                15m
                Logged:
                Time Spent - Not Specified
                Not Specified