The field 'X' was not recognised

Do you have an example to add validation to a simple text field?

On a seperate point, I now need to use Forum.php instead of Node.php .....
Is there a _presave method on the "forum"?

I had this in the old file
PHP:
protected function _preSave(){
   if (XenForo_Application::isRegistered('newthread_button_title')) {
      $this->set('newthread_button_title', XenForo_Application::get('newthread_button_title'));
   } else {
      $this->set('newthread_button_title', '');
   }
   return parent::_preSave();
}

The _preSave method is in the abstract datawriter, it's always available.

(However, it's marked as final in discussion and discussion message data writers, you have to use _messagePreSave and _discussionPreSave instead).

Liam
 
  • Like
Reactions: Rob
All done.... I've not bothered with a validator as the field is always valid regardless of content so didn't see the point.
 
Top Bottom