Pārlūkot izejas kodu

Reviewed and changed a bug fix (No TRAC entry) on the display of external fields when the external key is null. The actual fix is to consider that null is a value. Isset() should be used with care because one could not differentiate a missing value (in an array or a value that is null)

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@205 a333f486-631f-4898-b8df-5754b55c2be0
romainq 15 gadi atpakaļ
vecāks
revīzija
9ec0214718
1 mainītis faili ar 4 papildinājumiem un 2 dzēšanām
  1. 4 2
      core/dbobject.class.php

+ 4 - 2
core/dbobject.class.php

@@ -209,7 +209,9 @@ abstract class DBObject
 
 			// Note: we assume that, for a given attribute, if it can be loaded,
 			// then one column will be found with an empty suffix, the others have a suffix
-			if (isset($aRow[$sAttCode]))
+			// Take care: the function isset will return false in case the value is null,
+			// which is something that could happen on open joins
+			if (array_key_exists($sAttCode, $aRow))
 			{
 				$value = $oAttDef->FromSQLToValue($aRow, $sAttCode);
 
@@ -317,7 +319,7 @@ abstract class DBObject
 			$this->Reload();
 		}
 		$this->ComputeFields();
-		return isset($this->m_aCurrValues[$sAttCode]) ? $this->m_aCurrValues[$sAttCode] : '';
+		return $this->m_aCurrValues[$sAttCode];
 	}
 
 	public function GetOriginal($sAttCode)