Custom User Profile Fields Problem

Custom User Profile Fields Problem

by Mark Duffy -
Number of replies: 14
Hi,

The required field doesnt seem to be working for the custom user profile fields. No red star appears beside the field and the clients side validation isnt working. Does anyone know why this is happening.

--Mark
Average of ratings: -
In reply to Mark Duffy

Re: Custom User Profile Fields Problem

by Matt Campbell -
Are you running PHP4 or PHP5? I notice that this is working on my Moodle 1.9 install on PHP5, but not on my Moodle 1.8 install on PHP4. I'll get some test installs going this weekend and see what I find out - I think it's a bug, just need to work out all the details.

Thanks,
Matt
In reply to Matt Campbell

Re: Custom User Profile Fields Problem

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
Matt - Thanks for that information. I'm running on PHP 5 and Moodle 1.9 and it works. I do not have a PHP4 installation to test it on and I'm not all that interested in installing it either to test it. There are currently only 80 days left until PHP4 is no longer supported by the PHP community. I would certainly encourage moving to PHP5 if possible. I did not realize that importing custom user profiles was backported to Moodle 1.8. AFAIK it is only for Moodle 1.9. But if there is a bug with PHP4 then let's work to identify it and get it fixed. Peace - Anthony
In reply to Anthony Borrow

Re: Custom User Profile Fields Problem

by Lakshmi Iyer -
Strange. I am using Moodle 1.9 running on PHP 5.2.2 on windows. But still the red star doesnot appear on the custom user profile fields. Am I missing something??

Regards,
Lakshmi
In reply to Matt Campbell

Re: Custom User Profile Fields Problem

by Mark Duffy -
I tested it on php 5.2 and it still didnt work.
In reply to Mark Duffy

Re: Custom User Profile Fields Problem

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
Mark - My apologies, I misread your post and thought you were speaking of importing custom user fields which was an issue I was recently working with. I did not read carefully enough that you are having trouble with getting the required field setting working. Let me look into that now. Peace - Anthony
In reply to Mark Duffy

Re: Custom User Profile Fields Problem

by Matt Campbell -
Hmmm... I did some testing this weekend and this morning. Here are my results - it's got to be something in the details on this one.

OS
Moodle
PHP
MySQL
Apache
Works?
Debian-Linux
1.8
4.4.4.8.4
5.0.32
1.3
No
Debian-Linux 1.9
4.4.4.8.4
5.0.32
1.3
No
Debian-Linux 1.8
5.2.3.1.5
5.0.45
2.0
Yes
Debian-Linux 1.9
5.2.3.1.5 5.0.45
2.0
Yes

Any ideas?
In reply to Matt Campbell

Re: Custom User Profile Fields Problem

by Richard Enison -

MC,

Yeah. My ideas are that, looking at the table, what I see is that the results, other things being equal, are the same for Moodle 1.8 and 1.9; when you use php 5.2.3.1.5 with MySQL 5.0.45 and Apache 2.0, it works; when you use lower versions of all three, it doesn't. Period. Because those are the only two combinations you've tried.

So the next step would be to lower the version of one of the three at a time to see which one causes failure, i.e.:

PHP MySQL Apache
5.2.3.1.5 5.0.45 1.3
5.2.3.1.5 5.0.32 2.0
4.4.4.8.4 5.0.45 2.0

And if none of them does, try lowering two at a time, or, what amounts to the same thing, start with all three at the low version and raise the version of one of them at a time while holding the other two low; the opposite of what I did in the above table.

To save time, do this for just one version of Moodle, 1.8 or 1.9, at least at first, because so far it doesn't seem to matter which one you use. If I had to pick one, I'd go with 1.9, so whatever we learn will not be wasted on a version that will soon be more or less obsolete.

What I would do after that depends on the results of the above tests.

RLE

In reply to Matt Campbell

Re: Custom User Profile Fields Problem

by Sacha Brostoff -

Hi!

We are running the following, and custom fields are not working completely:

  • they don't appear in the new user registration screen
  • they do appear in the users' Edit Profile page, BUT
  • when looking in a user's Edit Profile page, the custom 'required' profile fields are not starred.


OS
Moodle
PHP
MySQL
Apache
Works?
CentOs 5
1.8.2+
5.1.6
5.0.22
2.2.3
No

Sacha

In reply to Sacha Brostoff

Re: Custom User Profile Fields Problem

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
Sacha - Could you check and see if this is added in the tracker. If not, create an issue for it as I was able to confirm the behavior using Moodle 1.8.3+ (2007021533). Peace - Anthony

p.s. - This issue was addressed for Moodle 1.9 but I am not sure that it was ever designed to show up on the signup page for Moodle 1.8.
In reply to Anthony Borrow

Re: Custom User Profile Fields Problem

by Sacha Brostoff -
Hi Anthony,

Have added it to the tracker... it's my first one, so may not have done it quite right.

All the best,

Sacha
In reply to Sacha Brostoff

Re: Custom User Profile Fields Problem

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
Sacha - Congratulations, it looks like you created MDL-12682 just fine. Thanks for filing that report. It seems worth looking at as I suspect that based on the available options that one might well suspect the behavior you desire. Since it was fixed in Moodle 1.9 hopefully a patch for 1.8 will not be too difficult.

One of the advantages of using the tracker is that you can easily make reference to it in the forums and it will automatically link back to the issue. Just type MDL- and then the tracker number and the link will appear when you save it. Peace - Anthony
In reply to Anthony Borrow

Re: Custom User Profile Fields Problem

by ces moce -
Hello

Did you find a solution to this problem?

When i am logged i can see the customs fields while i am creating a new account in Email-based self-registration? But when i 'm not logged i can see only the tiltle of this customs fields...
Attachment pb-customs-fields.jpg
In reply to ces moce

Re: Custom User Profile Fields Problem

by Giovanni Tomasello -
Hi,
i'm using moodle 1.9.5+, and i have still this problem.

My step are:
1) Go to: Administration > Users > Accounts > User profile fields

2) Create a new profile field

....
Is this field required? Yes
Is this field locked? No
Should the data be unique? No

3) Go to: Administration > Users > Accounts > Add a new user

4) My new field does not display in red and does not have a red asterisk next to it to indicate that it is a required field

5) You don't know that new field is a required field, so you leave it blank

6) Click 'Update Profile' to save your new user

7) New user is saved without custom field


There is a solution to the problem?
In reply to Mark Duffy

Re: Custom User Profile Fields Problem

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
Mark - What do you mean that the client side validation is not working. What are you trying to do. Could you provide a few more details so I can try to recreate the issue. I did find that if I tried to edit a custom user field that it asks me to change the shortname because it does not realize the difference between editing and creating (at least in terms of form validation). I'll try to check and see if that is in the tracker this evening; however, if you beat me to it well that is life in this competitive bugathon (and honestly I would not complain). Peace - Anthony