The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$archive_pages - Line: 2 - File: printthread.php(287) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/printthread.php(287) : eval()'d code 2 errorHandler->error
/printthread.php 287 eval
/printthread.php 117 printthread_multipage



UserSpice
custom fields - Printable Version

+- UserSpice (https://userspice.com/forums)
+-- Forum: General (https://userspice.com/forums/forumdisplay.php?fid=20)
+--- Forum: UserSpice 5 - Roadmapping the Future (https://userspice.com/forums/forumdisplay.php?fid=31)
+--- Thread: custom fields (/showthread.php?tid=949)

Pages: 1 2 3 4


custom fields - Brandin - 06-25-2018

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 - egerton - 06-25-2018

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.


custom fields - ebsjruiz - 06-25-2018

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.


custom fields - ebsjruiz - 06-27-2018

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


custom fields - Brandin - 06-27-2018

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.


custom fields - egerton - 06-27-2018

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.


custom fields - Brandin - 06-27-2018

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.


custom fields - egerton - 06-27-2018

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".


custom fields - egerton - 06-27-2018

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.


custom fields - ebsjruiz - 06-27-2018

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.