I wanted to add a custom field validation method, so I followed the example in the how to's as below.
But I always get the error messages below when the method returns false. (Works fine if validation is true.) Did something change in Dataface since the example was written? Or I'm I missing something here?
code:
-----------------------------------------
function Proteins__validate( & $record, $value, $params){
$result = true;
$proteins = explode(";",$value);
foreach($proteins as $k=>$line){
$seq=trim($line);
if ($seq !='') {
$ProteinRecord = df_get_record ( 'Proteins', array('Name' =>'='.$seq) );
if ($ProteinRecord == null){
$params['message'] = "Sorry, protein name: $seq not found.";
$result = false;
}// end if null
} //end if seq =''
} // end foreach
return $result;
} //end function
--------------------------------------------------------------------------------
Error returned:
Fatal error: [pear_error: message="" code=211 mode= level=notice prefix="" info="On line 74 of file /Library/WebServer/Documents/dataface/Dataface/Error.php in function printstacktrace()
On line 1394 of file /Library/WebServer/Documents/dataface/Dataface/QuickForm.php in function permissiondenied(,,)
On line 1273 of file /Library/WebServer/Documents/dataface/Dataface/QuickForm.php in function pushfield(Proteins)
On line 1862 of file /Library/WebServer/Documents/dataface/Dataface/QuickForm.php in function push()
On line of file in function save(FN2---FN5; GG36-G97E-S99N; GG36-G97D-S99N; GG36; BLAP; WO0183559-0031; US20050181446-0031; PB92---Sa)
On line 1608 of file /Library/WebServer/Documents/dataface/lib/HTML/QuickForm.php in function call_user_func(Object-save,FN2---FN5; GG36-G97E-S99N; GG36-G97D-S99N; GG36; BLAP; WO0183559-0031; US20050181446-0031; PB92---Sa)
On line 103 of file /Library/WebServer/Documents/dataface/actions/edit.php in function process(Object-save)
On line 742 of file /Lib in /Library/WebServer/Documents/dataface/Dataface/QuickForm.php on line 1881