Merge remote-tracking branch 'origin/support/2.5' into release/2.6

This commit is contained in:
Pierre Goiffon
2018-12-31 17:21:52 +01:00
2 changed files with 17 additions and 3 deletions

View File

@@ -332,6 +332,18 @@ class BulkChange
return true;
}
/**
* @param \DBObject $oTargetObj
* @param array $aRowData
* @param array $aErrors
*
* @return array
* @throws \CoreException
* @throws \CoreUnexpectedValue
* @throws \MissingQueryArgument
* @throws \MySQLException
* @throws \MySQLHasGoneAwayException
*/
protected function PrepareObject(&$oTargetObj, $aRowData, &$aErrors)
{
$aResults = array();
@@ -477,7 +489,9 @@ class BulkChange
if (!$oAttDef->IsWritable() && in_array($sAttCode, $this->m_aReconcilKeys)){ continue; }
$aReasons = array();
$iFlags = $oTargetObj->GetAttributeFlags($sAttCode, $aReasons);
$iFlags = ($oTargetObj->IsNew())
? $oTargetObj->GetInitialStateAttributeFlags($sAttCode, $aReasons)
: $oTargetObj->GetAttributeFlags($sAttCode, $aReasons);
if ( (($iFlags & OPT_ATT_READONLY) == OPT_ATT_READONLY) && ( $oTargetObj->Get($sAttCode) != $aRowData[$iCol]) )
{
$aErrors[$sAttCode] = Dict::Format('UI:CSVReport-Value-Issue-Readonly', $sAttCode, $oTargetObj->Get($sAttCode), $aRowData[$iCol]);

View File

@@ -308,12 +308,12 @@ class iTopExtensionsMap
$sModuleVersion = '0.0.1';
}
if ($sParentExtensionId !== null)
if (($sParentExtensionId !== null) && (array_key_exists($sParentExtensionId, $this->aExtensions)) && ($this->aExtensions[$sParentExtensionId] instanceof iTopExtension))
{
// Already inside an extension, let's add this module the list of modules belonging to this extension
$this->aExtensions[$sParentExtensionId]->aModules[] = $sModuleName;
$this->aExtensions[$sParentExtensionId]->aModuleVersion[$sModuleName] = $sModuleVersion;
}
}
else
{
// Not already inside an folder containing an 'extension.xml' file