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_.
custom fields
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.
(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.
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.
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.
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
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.
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.
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.
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.
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".
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.
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.
You need to create your post within admin_user_system_settings file as well.
A sample of this can be found from admin_user.php in the Post section.
A sample of this can be found from admin_user.php in the Post section.
I keep hitting this error - Undefined index: csrf
I tried adding the hidden csrf field to my [color=#666666]admin_user_system_settings to no avail[/color]
I tried adding the hidden csrf field to my [color=#666666]admin_user_system_settings to no avail[/color]
You are probably redefining the form or submit button...here is a sample admin_user_system_settings with data...
https://pastebin.com/mpB8FHks
https://pastebin.com/mpB8FHks
Ok great, it got it working now thanks! The only thing is there are no error/success blocks. Do I need to alter admin_user.php to display them on update for admin_user_system_settings.php fields?
I think this is a known issue if I remember correctly since I use this on my own install-and its because the POST comes after error and success messages.
I'll work on a solution for this in 4.4.
I'll work on a solution for this in 4.4.