PDA

View Full Version : custom userdata manager $validfields not working...


Disasterpiece
07-05-2011, 11:00 AM
Hi

Not sure if I did that all correct, I used this tutorial: https://www.vbulletin.com/docs/html/data_manager_advanced

To store additional information about a user, I added a field into the vb_user table with name "steam_link", type varchar(128) NOT NULL

Now I tried to modify it:

// set steam information
$userdata->set('steam_link', $steam_id);

According to the tutorial, I included the following plugin content into the hook "userdata_presave":
$this->validfields['steam_link'] = array(TYPE_STR, REQ_NO);

But I get the error:

Fatal error: Field steam_link is not defined in $validfields in class vB_DataManager_User in /var/www/.../forum/includes/class_dm.php on line 515

What am I missing?

kh99
07-05-2011, 11:51 AM
I think validfields needs to be changed before you call set() so you'd want to do it maybe in hook userdata_start.

Disasterpiece
07-05-2011, 07:07 PM
Works, thanks!