Protect against a non-existent "MapContextParams" function

SVN:trunk[1886]
This commit is contained in:
Denis Flaven
2012-03-09 08:44:06 +00:00
parent 2c49d1f96f
commit 73e715efb4
2 changed files with 17 additions and 14 deletions

View File

@@ -221,17 +221,17 @@ class ApplicationContext
if (is_callable($aCallSpec))
{
$sAttCode = call_user_func($aCallSpec, $key); // Returns null when there is no mapping for this parameter
}
if (MetaModel::IsValidAttCode($sClass, $sAttCode))
{
$oAttDef = MetaModel::GetAttributeDef($sClass, $sAttCode);
if ($oAttDef->IsWritable())
if (MetaModel::IsValidAttCode($sClass, $sAttCode))
{
$value = $this->GetCurrentValue($key, null);
if (!is_null($value))
$oAttDef = MetaModel::GetAttributeDef($sClass, $sAttCode);
if ($oAttDef->IsWritable())
{
$oObj->Set($sAttCode, $value);
$value = $this->GetCurrentValue($key, null);
if (!is_null($value))
{
$oObj->Set($sAttCode, $value);
}
}
}
}