mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Could not add more than one link between a given server and a given network device. This is a regression in 2.2.0 beta. This issue affect N-N links where duplicates are allowed. One single link is being affected in the standard datamodel.
SVN:trunk[3745]
This commit is contained in:
@@ -1135,8 +1135,18 @@ class AttributeLinkedSet extends AttributeDefinition
|
||||
return false;
|
||||
}
|
||||
|
||||
// Both values are Object sets
|
||||
return $val1->HasSameContents($val2);
|
||||
// Note: maintain this algorithm so as to make sure it is strictly equivalent to the one used within DBObject::DBWriteLinks()
|
||||
$sExtKeyToMe = $this->GetExtKeyToMe();
|
||||
$sAdditionalKey = null;
|
||||
if ($this->IsIndirect() && !$this->DuplicatesAllowed())
|
||||
{
|
||||
$sAdditionalKey = $this->GetExtKeyToRemote();
|
||||
}
|
||||
$oComparator = new DBObjectSetComparator($val1, $val2, array($sExtKeyToMe), $sAdditionalKey);
|
||||
$aChanges = $oComparator->GetDifferences();
|
||||
|
||||
$bAreEquivalent = (count($aChanges['added']) == 0) && (count($aChanges['removed']) == 0) && (count($aChanges['modified']) == 0);
|
||||
return $bAreEquivalent;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1366,9 +1366,10 @@ abstract class DBObject implements iDisplay
|
||||
if (!array_key_exists($sAttCode, $this->m_aTouchedAtt)) continue;
|
||||
if (array_key_exists($sAttCode, $this->m_aModifiedAtt) && ($this->m_aModifiedAtt[$sAttCode] == false)) continue;
|
||||
|
||||
// Note: any change to this algorithm must be reproduced into the implementation of AttributeLinkSet::Equals()
|
||||
$sExtKeyToMe = $oAttDef->GetExtKeyToMe();
|
||||
$sAdditionalKey = null;
|
||||
if ($oAttDef->IsIndirect())
|
||||
if ($oAttDef->IsIndirect() && !$oAttDef->DuplicatesAllowed())
|
||||
{
|
||||
$sAdditionalKey = $oAttDef->GetExtKeyToRemote();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user