Browse Source

Bug fix: incorrect detection of the need to fix HK, leading to incorrect data in case of upgrade.

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

+ 1 - 1
core/metamodel.class.php

@@ -2665,7 +2665,7 @@ if (!array_key_exists($sAttCode, self::$m_aAttribDefs[$sClass]))
 			$sRight = $oAttDef->GetSQLRight();
 			$sSQL = "SELECT MAX(`$sRight`) AS MaxRight FROM `$sTable`";
 			$iMaxRight = CMDBSource::QueryToScalar($sSQL);
-			$sSQL = "SELECT COUNT(`$sRight`) AS Count FROM `$sTable`";
+			$sSQL = "SELECT COUNT(*) AS Count FROM `$sTable`"; // Note: COUNT(field) returns zero if the given field contains only NULLs
 			$iCount = CMDBSource::QueryToScalar($sSQL);
 			if (!$bForceComputation && ($iCount != 0) && ($iMaxRight == 0))
 			{