fieldname__validate give Permission Denied error

A place for users and developers of the Xataface to discuss and receive support.

fieldname__validate give Permission Denied error

Postby muzafar » Thu May 10, 2012 4:56 am

Greetings,

I am creating a function in table delegate class for file validation, but after submission of form while editing record, I am getting the "Permission Denied Error". The function I have write is:

function workPlan__validate(&$record,$value,&$params)
{
$app =& Dataface_Application::getInstance();
$query =& $app->getQuery();

if($value['name'] == NULL)
{
$appid = $record->val('id');
$res = mysql_query("select workPlan from applications where id = '".$appid."'", df_db());
if (!$res ) throw new Exception(mysql_error(df_db()));
$data = mysql_fetch_array($res);

if(empty($data[0]))
{
return (PEAR::raiseError("Please upload workplan",DATAFACE_E_NOTICE));
}

}
}

kindly lead me.
muzafar
 
Posts: 44
Joined: Mon Nov 28, 2011 9:25 pm

Re: fieldname__validate give Permission Denied error

Postby shannah » Tue May 15, 2012 9:47 am

The fieldname__validate() method should return a boolean value, not an error.
http://www.xataface.com/wiki/fieldname__validate
(i.e. false on failure)
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 1 guest

Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved