× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
custom fields
#21
If you want them on user_settings you have to make those changes manually. If you want them on admin_user.php you can duplicate the example_admin_user_system_settings file removing example_.
  Reply
#22
Hello guys. I am having some trouble with my custom registration form. I added some additional fields to the database and made changes to the additional_join_form_field and the during_user_creation files like so:

(additional_join_form_field.php)

<label for="street">Street*</label>
<input type="text" class="form-control input-sm" id="street" name="street" placeholder="Street" value="<?php if (!$form_valid
&& !empty($_POST)){ echo $street;} ?>" required autofocus>
=========================================================================

(during_user_creation.php)

$db->update(‘users’,$theNewId,[‘street’ =>Input::get('street']);

None of the additional fields I added were posted to the database.
  Reply
#23
I cannot get it to successfully update

I am just trying to follow the initial walkthru in the code notes using account_id

Error: An invalid form control with name='account_id' is not focusable.
  Reply
#24
Also, is there a way to trigger the during user creation functionality during update as well? I think I can hack something but would rather use the recommended practice
  Reply
#25
Hi there,

Sorry for the delay in getting back to you. during_user_creation is called during both regular registration and manual addition. Your code seems correct, to use the $theNewId variable and run the update command. That being said, is it producing any errors?

Add $dnd($db->errorInfo()) to your during_user_creation file after that command to see if it posts anything.
  Reply
#26
The only message i got is "There was a problem creating an account." I went ahead and tried modifying the _join form which works if I have three custom fields. If I exceed three custom fields, i get the message "There was a problem creating an account." I wish someone on this forum would share how they got it to work.
  Reply
#27
If there was a problem creating the account, there was more than likely an error that occurred during the insert. The new columns you added, are they nullable? If not, the insert is going to fail and that would be your issue.
  Reply
#28
It actual works with nullable columns but once I insert more than three fields into the users table I get the message “There was a problem creating an account".
  Reply
#29
All Null columns. It works fine with three custom fields but when I try to insert more than three custom field the message “There was a problem creating an account” appears again.
  Reply
#30
Right I have everything working on new users, both manual and register. I am focused on updating users. I need these new fields to be updatable and also trigger certain actions on update. Just wondering if there was a built in way versus hacking something. I got the field to appear via admin_user_system_settings.php but it will not update.
  Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)