Ok, so I'm extending the Register controller and actionRegister. This is a very basic version of what I'm doing...
I've extended the User Data Writer so that the _getFields function includes the myaddon_data field.
One of two things happens...
If $writer->save is in the code then I get some errors - understandable as presumably I'm trying to write a row to the xf_user table that doesn't have some crucial fields set yet, such as user_id and other required fields.
If I remove $writer->save I get no errors, but the data isn't saved at all.
I'm sure I'm missing something that will solve this
Help is much appreciated
PHP:
$parent = parent::actionRegister();
$dataId = MyAddOn_Helper_MyAddOnHelper::getDataId();
$writer = $writer = XenForo_DataWriter::create('XenForo_DataWriter_User');
$writer->set('myaddon_data', $dataId);
$writer->save();
return $parent;
I've extended the User Data Writer so that the _getFields function includes the myaddon_data field.
One of two things happens...
If $writer->save is in the code then I get some errors - understandable as presumably I'm trying to write a row to the xf_user table that doesn't have some crucial fields set yet, such as user_id and other required fields.
If I remove $writer->save I get no errors, but the data isn't saved at all.
I'm sure I'm missing something that will solve this
Help is much appreciated