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

In hook_civicrm_post, objectId parameter is NULL for Relationship entity

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.4.6
    • Fix Version/s: 4.4.13, 4.5.5
    • Component/s: Core CiviCRM
    • Labels:
      None
    • Documentation Required?:
      None

      Description

      hook_civicrm_post( $op, $objectName, $objectId, &$objectRef )

      I've noticed that in the post hook, when the entity is a Relationship the $objectId parameter is NULL. When the entity is eg. a Contact, $objectId is correctly the entity ID.

      There is an easy workaround for this- using $objectRef->id instead of $objectId.

      It's possible that this issue is behind CRM-13306 (affecting 4.3.3).

        Attachments

          Activity

            People

            • Assignee:
              colemanw Coleman Watts
              Reporter:
              DaveFF David Knoll
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: