Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Can't seem to add fields to User Model

edited January 2011 in Vanilla 2.0 - 2.8
I'm working on a plugin to perform geo-coding of users when they submit their profile information. I've been trying to add some new fields to the UserModel during the BeforeSaveValidation and BeforeSave hooks, but nothing I add makes it's way into the database.

Going over the code in class.usermodel.php it appears that while I am passed the fields in an EventArguments array as either FormPostValues or Fields arrays, any changes to those arrays are never written back to the source arrays. So no added fields are ever really added.

Am I missing something? Is there another way to add fields to the usermodel in these hooks so they are updated in the database?

For now, I've hacked the class.usermodel.php file to write changes to the EventArguments arrays back to the source arrays, which works, but I hate to make changes to the core code.

Thanks in advance,

Thom Howard
Tagged:
Sign In or Register to comment.