Commit 7b19a9b6 authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

(mvc) extend basemodel

(cherry picked from commit c1a58cdd)
parent 907937c1
......@@ -326,10 +326,10 @@ abstract class BaseModel
* perform a validation on changed model fields, using the (renamed) internal reference as a source pointer
* for the requestor to identify its origin
* @param null|string $sourceref source reference, for example model.section
* @param null|string $targetref target reference, for example section
* @param string $targetref target reference, for example section. used as prefix if no source given
* @return array list of validation errors, indexed by field reference
*/
public function validate($sourceref = null, $targetref = null)
public function validate($sourceref = null, $targetref = "")
{
$result = array();
$valMsgs = $this->performValidation();
......@@ -339,7 +339,8 @@ abstract class BaseModel
$fieldnm = str_replace($sourceref, $targetref, $msg->getField());
$result[$fieldnm] = $msg->getMessage();
} else {
$result[$msg->getField()] = $msg->getMessage();
$fieldnm = $targetref . $msg->getField() ;
$result[$fieldnm] = $msg->getMessage();
}
}
return $result;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment