Loading...
 
Features / Usability

Features / Usability


custom userfields in user preferences wont save the data back, error

posts: 41 Germany

Hello,

I want to use the cutom userfields functionality in tikiwiki and created a new row in the database, in table tiki_user_preferences :

name "CustomFields"
prefName "Phone"
value ""

When I now click on My Userprefs in tikiwiki I see this custom field correct, but when I enter data and press save, the data would not be saved. When I press save I the Preferences Box below I got an error saying:

Notice: Undefined index: phone in /var/www/html/chelpdesk/tiki-user_preferences.php on line 116


He reads the costum user fields correct, but not save it back.

Hopefully somebody can help me.

Big thanks,

Peter

posts: 41 Germany

Hello,

now I got the problem solved.
I am not a developer and got no clue about the way to put thinks into the tikiwiki dev CVS.

But there was an little error in the tiki-user_preferences.php file:

The foreach code part titled with "// Custom fields" runs when you click on the change preferences button in your user-preferences page.

But this is wrong, because the costum user fields would be listed under the first part, the user info part.

When you delete or comment out the code part from the
if $_REQUEST%22prefs%22 {
Statement and put the following code:

// Custom fields
foreach ($customfields as $custpref=>$prefvalue ) {
$tikilib->set_user_preference($userwatch, $customfields$custpref'prefName', $_REQUEST[$customfields$custpref'prefName']);
}

at the end of the:
if 'info'" class="wiki wikinew text-danger tips isset">$_REQUEST'info' {
Statement it works perfectly!

You are now able to define costum user fields in the database.
You see this costum user fields in the my-preferences screen,
can edit them and the fields would correctly saved back to the databse.

Hopefully I can help someone with this information.

When anybody got questions about that, please ask.

Thanks, Peter


Upcoming Events

1)  18 Apr 2024 14:00 GMT-0000
Tiki Roundtable Meeting
2)  16 May 2024 14:00 GMT-0000
Tiki Roundtable Meeting
3)  20 Jun 2024 14:00 GMT-0000
Tiki Roundtable Meeting
4)  18 Jul 2024 14:00 GMT-0000
Tiki Roundtable Meeting
5)  15 Aug 2024 14:00 GMT-0000
Tiki Roundtable Meeting
6)  19 Sep 2024 14:00 GMT-0000
Tiki Roundtable Meeting
7) 
Tiki birthday
8)  17 Oct 2024 14:00 GMT-0000
Tiki Roundtable Meeting
9)  21 Nov 2024 14:00 GMT-0000
Tiki Roundtable Meeting
10)  19 Dec 2024 14:00 GMT-0000
Tiki Roundtable Meeting