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)

SVN:trunk[205]
This commit is contained in:
Romain Quetiez
2009-12-26 13:18:56 +00:00
parent 37c5880ced
commit ae1e7e224a

View File

@@ -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)