Skip to content

Commit

Permalink
Fix salesagility#10541 - Relation M2M between Security Groups and Sec…
Browse files Browse the repository at this point in the history
…urity Groups raises an error
  • Loading branch information
SinergiaCRM committed Oct 7, 2024
1 parent 80ee82d commit 5316194
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions data/Relationships/M2MRelationship.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ public function add($lhs, $rhs, $additionalFields = array())
//Need to hijack this as security groups will not contain a link on the module side
//due to the way the module works. Plus it would remove the relative ease of adding custom module support

if (get_class($rhs) != 'User' && get_class($rhs) != 'ACLRole' && get_class($lhs) == 'SecurityGroup') {
if (get_class($rhs) != 'User' && get_class($rhs) != 'ACLRole' && get_class($lhs) == 'SecurityGroup' && get_class($rhs) != 'SecurityGroup') {
$rhs->$rhsLinkName->addBean($lhs);
$this->callBeforeAdd($rhs, $lhs, $rhsLinkName);

$dataToInsert = $this->getRowToInsert($lhs, $rhs, $additionalFields);
$this->addRow($dataToInsert);
$rhs->$rhsLinkName->addBean($lhs);
$this->callAfterAdd($lhs, $rhs, $lhsLinkName);
} elseif (get_class($lhs) != 'User' && get_class($lhs) != 'ACLRole' && get_class($rhs) == 'SecurityGroup') {
} elseif (get_class($lhs) != 'User' && get_class($lhs) != 'ACLRole' && get_class($rhs) == 'SecurityGroup' && get_class($lhs) != 'SecurityGroup') {
$lhs->$lhsLinkName->addBean($rhs);
$this->callBeforeAdd($lhs, $rhs, $lhsLinkName);

Expand Down

0 comments on commit 5316194

Please sign in to comment.