Gossamer
Active member
Hello! So, I'm trying to add a new option when creating a forum node. I've already created the option in the admin CP as a radio button list. The new field has been added to the xf_forum table, called 'forum_type'.
However, when I try to save the forum node, nothing gets saved to the forum_type field.
Here is my ControllerAdmin/Forum.php:
And here is my Datawriter:
What am I doing wrong?
However, when I try to save the forum node, nothing gets saved to the forum_type field.
Here is my ControllerAdmin/Forum.php:
PHP:
class Goss_RoleplaySystem_ControllerAdmin_Forum extends XFCP_Goss_RoleplaySystem_ControllerAdmin_Forum
{
public function actionSave()
{
$response = parent::actionSave();
if($response->redirectType == XenForo_ControllerResponse_Redirect::SUCCESS)
{
$data = $this->_input->filter(array(
'forum_type' => XenForo_Input::STRING
));
$dw = XenForo_DataWriter::create('Goss_RoleplaySystem_DataWriter_Forum');
$dw->bulkSet($data);
$dw->save();
}
return $response;
}
}
And here is my Datawriter:
PHP:
class Goss_RoleplaySystem_DataWriter_Forum extends XFCP_Goss_RoleplaySystem_DataWriter_Forum
{
protected function _getFields()
{
$fields = parent::_getFields();
$fields + array('xf_forum' => array(
'type' => self::TYPE_STRING,
'default' => NULL
));
return $fields;
}
}
What am I doing wrong?