Joomla! Discussion Forums



It is currently Fri Nov 27, 2009 6:25 am (All times are UTC )

 




Post new topic Reply to topic  [ 2 posts ] 
Author Message
Posted: Thu Nov 05, 2009 10:29 pm 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Wed Oct 21, 2009 10:43 pm
Posts: 4
When an error is thrown in a Table class such as:
Code:
if (trim($this->desc) == '') {
$this->setError(JText::_('MAND_COINDESC'));
return false;
}

Which was called from a store() method of a Model:
Code:
// Validate
if (!$row->check()) {
$this->setError($row->getErrors());
return false;
}

Which was called from a controller:
Code:
if ($model->store($post)) {
$msg = JText::_( 'DETAILSAVED' );
} else {
$msg = JText::_( 'DETAILSAVEERROR' );
}
...
$this->setRedirect( $link,$msg );


Where do the error messages set in the table check() method display?
The page (list of items) shows the 'Error Saving xxx' message, but the details set in the check method are not propagated up to the view it seems.

Anybody have the right code to make the magic happen?


Top
  E-mail  
 
Posted: Mon Nov 09, 2009 5:06 pm 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Wed Oct 21, 2009 10:43 pm
Posts: 4
Still looking for an answer. Can anybody help? I'm a firm believer in strong server side validation of input data, but the error messages don't see to filter up the stack, and I can't find any working examples from the Table class up.


Top
  E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

Quick reply

 



Who is online

Users browsing this forum: No registered users and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group