Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #10541 - Relation M2M between Security Groups and Security Groups raises an error #10542

Open
wants to merge 1 commit into
base: hotfix
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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