Skip to content

Commit

Permalink
Merge pull request #22404 from eileenmcnaughton/hooky
Browse files Browse the repository at this point in the history
Stop calling hook twice
  • Loading branch information
eileenmcnaughton authored Jan 7, 2022
2 parents e9fc27f + 4b1ba25 commit 4529501
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
6 changes: 0 additions & 6 deletions CRM/Contact/BAO/Contact/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,12 +332,6 @@ private static function legacyCreateMultiple(&$params, int $contactID) {
$relationships = $relationshipIds = [];
$ids = ['contact' => $contactID];

//CRM-9015 - the hooks are called here & in add (since add doesn't call create)
// but in future should be tidied per ticket
$hook = 'create';
// @todo pre hook is called from add - remove it from here
CRM_Utils_Hook::pre($hook, 'Relationship', NULL, $params);

// creating a new relationship
$dataExists = CRM_Contact_BAO_Relationship::dataExists($params);
if (!$dataExists) {
Expand Down
5 changes: 0 additions & 5 deletions CRM/Contact/BAO/Relationship.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,6 @@ public static function legacyCreateMultiple(&$params, $ids = []) {
$ids = ['contact' => $ids['contact']];
// Likewise neither place ever passed in relationshipID
$relationshipId = NULL;
$hook = 'create';
// CRM-9015 - the hooks are called here & in add (since add doesn't call create)
// but in future should be tidied per ticket
// @todo pre hook is called from add - remove it from here
CRM_Utils_Hook::pre($hook, 'Relationship', $relationshipId, $params);

if (!$relationshipId) {
// creating a new relationship
Expand Down

0 comments on commit 4529501

Please sign in to comment.