I seem to be having a bit of trouble extending the User DataWriter. Whenever the particular code is executed, I get this in the server error log:
XenForo_Exception: The field 'tokens' was not recognised. - library/XenForo/DataWriter.php:1333
Stack Trace:
Code that's on or near line 465 in Upgrades.php:
Finally, here's what I'm extending to the DataWriter:
Could someone point out the problem please? Thank you
XenForo_Exception: The field 'tokens' was not recognised. - library/XenForo/DataWriter.php:1333
Stack Trace:
Code:
#0 /home/se7ensin/public_html/forums/library/XenForo/DataWriter.php(1375): XenForo_DataWriter->_haveErrorsPreventSave()
#1 /home/se7ensin/public_html/forums/library/NixFifty/UpgradesPlus/Model/Upgrades.php(465): XenForo_DataWriter->save()
#2 /home/se7ensin/public_html/forums/library/NixFifty/UpgradesPlus/Model/PayPal.php(255): NixFifty_UpgradesPlus_Model_Upgrades->upgradeUser('649260', '478168', Array)
#3 /home/se7ensin/public_html/forums/gift_callback.php(31): NixFifty_UpgradesPlus_Model_PayPal->processTransaction()
#4 {main}
Code that's on or near line 465 in Upgrades.php:
Code:
$dw = XenForo_DataWriter::create('XenForo_DataWriter_User');
$dw->setExistingData($payUser);
$dw->set('tokens', $payUser['tokens'] + 1);
$dw->save();
Finally, here's what I'm extending to the DataWriter:
Code:
protected function _getFields()
{
$result = parent::_getFields();
$result['xf_user']['tokens'] = array('type' => self::TYPE_FLOAT, 'default' => 0);
return $result;
}
Could someone point out the problem please? Thank you