Browse Source

Fixed issues in DB integrity check

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@889 a333f486-631f-4898-b8df-5754b55c2be0
romainq 14 năm trước cách đây
mục cha
commit
d85bdea30e
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      core/metamodel.class.php

+ 2 - 2
core/metamodel.class.php

@@ -3007,7 +3007,7 @@ abstract class MetaModel
 					$sRemoteTable = self::DBGetTable($sRemoteClass);
 					$sRemoteKey = self::DBGetKey($sRemoteClass);
 
-					$aCols = $oKeyAttDef->GetSQLExpressions(); // Workaround a PHP bug: sometimes issuing a Notice if invoking current(somefunc())
+					$aCols = $oAttDef->GetSQLExpressions(); // Workaround a PHP bug: sometimes issuing a Notice if invoking current(somefunc())
 					$sExtKeyField = current($aCols); // get the first column for an external key
 
 					// Note: a class/table may have an external key on itself
@@ -3054,7 +3054,7 @@ abstract class MetaModel
 					{
 						$sExpectedValues = implode(",", CMDBSource::Quote(array_keys($aAllowedValues), true));
 	
-						$aCols = $oKeyAttDef->GetSQLExpressions(); // Workaround a PHP bug: sometimes issuing a Notice if invoking current(somefunc())
+						$aCols = $oAttDef->GetSQLExpressions(); // Workaround a PHP bug: sometimes issuing a Notice if invoking current(somefunc())
 						$sMyAttributeField = current($aCols); // get the first column for the moment
 						$sDefaultValue = $oAttDef->GetDefaultValue();
 						$sSelWrongRecs = "SELECT DISTINCT maintable.`$sKeyField` AS id FROM `$sTable` AS maintable WHERE maintable.`$sMyAttributeField` NOT IN ($sExpectedValues)";