Hi,
I'm creating an addon that is using a cron job to update user's custom field with individual values. I'm doing this using:
But running the cron I get this error message:
I think this is because the custom user field is not user editable. Options of my user custom field:
My Users shouldn't be able to edit it. I just want to store individual additional user data in the field using my newly created cron job.
After some research I found this:
But this is for Xenforo 1. How can I solve this problem in Xenforo 2?
Thanks!
I'm creating an addon that is using a cron job to update user's custom field with individual values. I'm doing this using:
PHP:
$user->Profile->custom_fields->field_id = 'individual_value';
$user->Profile->save();
But running the cron I get this error message:
Field field_name is not editable.
I think this is because the custom user field is not user editable. Options of my user custom field:
My Users shouldn't be able to edit it. I just want to store individual additional user data in the field using my newly created cron job.
After some research I found this:
$writer->setOption(XenForo_DataWriter_User::OPTION_ADMIN_EDIT, true);
How to edit custom profile field that is not user editable?
How do I edit a custom profile field that is not user editable? The following code allows me to set the field only if I make the field editable by any users. I do not want to let people edit this field because it allows them to impersonate other people. $writer =...
xenforo.com
How to use the datawriter to write a value to a custom user field
Could someone point me in the right direction please? I've tried a multitude of ways and I just can't get my head round it I have an addon that creates a customfield, lets call it mycustomfield (A 3 digit integer). I have the value to be inserted stored in $myinteger I would have assumed it...
xenforo.com
But this is for Xenforo 1. How can I solve this problem in Xenforo 2?
Thanks!