mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Merge remote-tracking branch 'origin/support/3.0' into support/3.1
This commit is contained in:
@@ -2704,15 +2704,19 @@ abstract class DBObject implements iDisplay
|
||||
continue;
|
||||
}
|
||||
|
||||
/** @noinspection NotOptimalIfConditionsInspection */
|
||||
/** @noinspection TypeUnsafeComparisonInspection */
|
||||
if (utils::IsNullOrEmptyString($sRemoteObjectClass)
|
||||
|| utils::IsNullOrEmptyString($sRemoteObjectKey)
|
||||
|| ($sRemoteObjectKey == 0) // non-strict comparison as we might have bad surprises
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 0 : Undefined ext. key (EG. non-mandatory and no value provided)
|
||||
// < 0 : Non yet persisted object
|
||||
/** @noinspection TypeUnsafeComparisonInspection Non-strict comparison as object ID can be string */
|
||||
if ($sRemoteObjectKey <= 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (false === $oIsObjectLoadableCallback($sRemoteObjectClass, $sRemoteObjectKey)) {
|
||||
throw new InvalidExternalKeyValueException($this, $sAttDefCode);
|
||||
}
|
||||
|
||||
@@ -1153,6 +1153,9 @@ class ObjectFormManager extends FormManager
|
||||
} catch (CoreCannotSaveObjectException $e) {
|
||||
throw new Exception($e->getHtmlMessage());
|
||||
} catch (InvalidExternalKeyValueException $e) {
|
||||
ExceptionLog::LogException($e, $e->getContextData());
|
||||
$bExceptionLogged = true;
|
||||
|
||||
throw new Exception($e->getIssue());
|
||||
} catch (Exception $e) {
|
||||
$aContext = [
|
||||
|
||||
@@ -558,6 +558,7 @@ class DBObjectTest extends ItopDataTestCase
|
||||
$oPersonLinks = \DBObjectSet::FromScratch(lnkPersonToTeam::class);
|
||||
$oPersonLinks->AddObject(MetaModel::NewObject(lnkPersonToTeam::class, [
|
||||
'person_id' => self::INVALID_OBJECT_KEY,
|
||||
'team_id' => $oTeam->GetKey(),
|
||||
]));
|
||||
$oTeam->Set('persons_list', $oPersonLinks);
|
||||
|
||||
@@ -582,6 +583,7 @@ class DBObjectTest extends ItopDataTestCase
|
||||
$oPersonLinks = \DBObjectSet::FromScratch(lnkPersonToTeam::class);
|
||||
$oPersonLinks->AddObject(MetaModel::NewObject(lnkPersonToTeam::class, [
|
||||
'person_id' => $oPersonOnDemoOrg->GetKey(),
|
||||
'team_id' => $oTeam->GetKey(),
|
||||
]));
|
||||
$oTeam->Set('persons_list', $oPersonLinks);
|
||||
|
||||
@@ -603,6 +605,7 @@ class DBObjectTest extends ItopDataTestCase
|
||||
$oPersonLinks = \DBObjectSet::FromScratch(lnkPersonToTeam::class);
|
||||
$oPersonLinks->AddObject(MetaModel::NewObject(lnkPersonToTeam::class, [
|
||||
'person_id' => $oPersonOnItDepartmentOrg->GetKey(),
|
||||
'team_id' => $oTeam->GetKey(),
|
||||
]));
|
||||
$oTeam->Set('persons_list', $oPersonLinks);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user