Custom profile field breaks profile editing

Custom profile field breaks profile editing

by Caroline Moore -
Number of replies: 4
I am running Moodle 1.8.3 on a LAMP server.

I just added a custom profile field called "active," with two possibilities: 0 (default) and 1.

Settings:
Required = yes
Locked = no
Visible to = not visible
Menu options = 0,1 (on separate lines)
Default = 0

Immediately after saving this new field, I tried to edit a user profile. Instead of the normal editing screen, I got a completely blank page (logged in as admin). If I log in as a regular user and try to edit my profile, I get the same result.

Profiles are still viewable, and the field does show up there (to me as an admin; didn't check for others).

I deleted the custom field, but I am still experiencing this problem.

Any help would be greatly appreciated!
Average of ratings: -
In reply to Caroline Moore

Re: Custom profile field breaks profile editing

by Caroline Moore -
Additional symptoms:

Some users can edit their profiles, some can't. There is no correlation between system-level or course-level roles and ability to edit profiles. (I.e. some admin accounts can, some can't, etc)

It does not seem to be correlated to version of Firefox or OS (Win vs Mac). IE never works. What's more, two users (one admin, one non-admin) could edit their profiles until testing it in IE on Windows. Now neither can edit their profile in any browser on any OS.


Here are the error messages that appear when I turn debugging on:

Notice
: Undefined variable: string in /var/www/html/lib/moodlelib.php on line 4847

Fatal error: Unsupported operand types in /var/www/html/user/editlib.php on line 164


The code around line 164 in editlib.php is:

163 $choices = get_list_of_countries();
164 $choices= array(''=>get_string('selectacountry').'...') + $choices;
165 $mform->addElement('select', 'country', get_string('selectacountry'), $choices);
166 $mform->addRule('country', $strrequired, 'required', null, 'client');
167 if (!empty($CFG->country)) {
168 $mform->setDefault('country', $CFG->country);

In reply to Caroline Moore

Re: Custom profile field breaks profile editing

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
Caroline - Would you mind filing an issue on this in the tracker and reference this forum thread? Then, if you could send me a Moodle message with the tracker number and I will go in and take a look at it to see if I can figure out what is going on and hopefully prepare a patch (if one is needed). Peace - Anthony
In reply to Anthony Borrow

Re: Custom profile field breaks profile editing

by Caroline Moore -
Thanks, Anthony. It's http://tracker.moodle.org/browse/MDL-15607 .

I'll keep testing and post my results here and/or in Tracker.
In reply to Caroline Moore

Re: Custom profile field breaks profile editing

by Caroline Moore -
My server admin and I figured out what was causing the problem and how to solve it, but not why it happened in the first place. I've posted about it on the Tracker.