[BUG] v2.1.6 Configuration > Profile

Post modules, themes or any other code you want to share with the community.

Moderator: Developers

meth
Posts: 1
Joined: Thu Feb 22, 2007 11:53 pm

[BUG] v2.1.6 Configuration > Profile

Postby meth » Fri Feb 23, 2007 12:13 am

v2.1.6 Community on *NIX Apache

Description: User Profile cannot update if $config['required_registration_fields']=''.

Reason: Even if required_registration_fields is an empty string, it is added to the array of required fields. configuration/index.php function check_fields() will always return false because $_POST[''] is empty.

Duplication: Set $config['required_registration_fields'] to an empty string or NULL. Login as a user or admin. Try to update your profile.

Fix: Modify configuration/index.php - function check_fields().

OPEN: configuration/index.php
FIND: -- if(empty($_POST[$field]) && !in_array($field, $disabled_user_fields)) -- [line 23]
REPLACE WITH: -- if($field != '' && empty($_POST[$field]) && !in_array($field, $disabled_user_fields)) --
SAVE & CLOSE
mschering
Site Admin
Site Admin
Posts: 8219
Joined: Tue Apr 20, 2004 1:06 pm
Location: The Netherlands - Den Bosch
Contact:

Postby mschering » Fri Feb 23, 2007 8:59 am

Thanks, fixed it. This bug also existed at user registration
Best regards,

Merijn Schering
Intermesh
ericinwisconsin
Posts: 3
Joined: Sat Aug 19, 2006 8:57 pm

Postby ericinwisconsin » Sun Jul 29, 2007 11:18 pm

This fix didn't work for me. Here's what my original index.php looks like:

if(!empty($field) && empty($_POST[$field]) && !in_array($field, $disabled_user_fields))

That's slightly different than the one shown above. I'm using 2.16-13.

Can anyone tell em the correct code? When I try the one above, I get this error:

Parse error: syntax error, unexpected ']', expecting T_STRING or T_VARIABLE or T_NUM_STRING in /var/www/websites/sherwoodnation.net/webmail/configuration/index.php on line 37

So I figured I needed two sets of quotation marks, thus:

if($field != "" && empty($_POST[$field]) && !in_array($field, $disabled_user_fields))

This gets rid of the above error, but still gives me the "You didn't fill in all the required fields" error. Any ideas what's wrong?
mschering
Site Admin
Site Admin
Posts: 8219
Joined: Tue Apr 20, 2004 1:06 pm
Location: The Netherlands - Den Bosch
Contact:

Postby mschering » Mon Jul 30, 2007 8:03 am

This bug was definitely fixed.

I don't see any error in your code.
Best regards,

Merijn Schering
Intermesh

Who is online

Users browsing this forum: No registered users and 4 guests

cron