mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-29 21:48:45 +02:00
#1111 Could not attach a UserRequest to a Problem (1-N links). Could not detach either! This fix requires attention: it is assumed that an item of a link set, if it is "modified" then its key to the current object has already been set.
SVN:trunk[3693]
This commit is contained in:
@@ -1384,24 +1384,13 @@ abstract class DBObject implements iDisplay
|
||||
|
||||
foreach($aChanges['modified'] as $oLink)
|
||||
{
|
||||
// Make sure that the objects in the set point to "this"
|
||||
$oLink->Set($oAttDef->GetExtKeyToMe(), $this->m_iKey);
|
||||
// Objects in the set either remain attached or have been detached -> leave the link as is
|
||||
$oLink->DBWrite();
|
||||
}
|
||||
|
||||
foreach($aChanges['removed'] as $oLink)
|
||||
{
|
||||
// Objects can be removed from the set because:
|
||||
// 1) They should no longer exist
|
||||
// 2) They are about to be removed from the set BUT NOT deleted, their ExtKey has been reset
|
||||
if ($oLink->IsModified() && ($oLink->Get($sExtKeyToMe) != $this->m_iKey))
|
||||
{
|
||||
$oLink->DBWrite();
|
||||
}
|
||||
else
|
||||
{
|
||||
$oLink->DBDelete();
|
||||
}
|
||||
$oLink->DBDelete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user