Last modified: 2013-03-28 03:01:18 UTC
Found this in 1.6.1, confirmed same in current svn. In the "Email" box of the "User Profile" tab of User Preferences. Before any email address is provided, the checkboxes are enabled (not sure if they should be, but that's another topic). You can save some changes. Enter an email address and save. Now the email box has a message about email not yet authenticated and the checkboxes are disabled. But if you save the page it refreshes and all the checkboxes are now unchecked.
Under current SVN, when no email address has been provided, the email checkboxes aren't even shown...unable to reproduce.
Just updated to rev 13679.. no change for me, still behaves as I described. I see that line 479 of includes/SpecialPreferences.php is working fine in checking for unset email, but in the else block it sets $disableEmailPrefs to false at line 492. Changing this to true makes those checkboxes grayed out before you enter an email address, but saving other changes again saves all those checkboxes as off. Line 659 only checks $wgEnableEmail to decide whether to show that email box.. I don't see any logic that would hide this completely when no email address has been given. svn info reports: URL: http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3 is this not current?
Disabled form controls don't sent their values with the form submission. This is equivalent to leaving the boxes unchecked from the perspective of looking at the incoming data. To allow the values to persist while disabled, some logic would need to be added to avoid overwriting those values under the circumstances where they'd be disabled. A hackaround might be to send a hidden field as well, or to avoid trying to save over them when reading in data.
Created attachment 1560 [details] Add hidden form inputs for checked+disabled checkboxes Here is a patch to add hidden form inputs.
Just updated to rev 20087, still behaves as described above.
Created attachment 3282 [details] Add hidden form inputs for checked+disabled checkboxes
Can you explain what this change is for? - $disableEmailPrefs = false; + $disableEmailPrefs = true;
Created attachment 3303 [details] Add hidden form inputs for checked+disabled checkboxes That part of the diff was intended to disable the checkboxes when no email address has been entered yet. I see now this would also disable them when $wgEmailAuthentication is false.. don't want that. Adding new patch to fix that and also disable the ccmeonemails checkbox when the others are disabled.
+testme, CC'ing Andrew to see if this is still a problem with new prefs.
*Bulk BZ Change: +Patch to open bugs with patches attached that are missing the keyword*
In addition to the checkboxes under the user profile. Where it shows the user his emailaddress (if using emailadres is enabled in the settings), the email from the user record is shown. However, if I change some preferences and press 'save', the emailaddress of the user is changed to an empty email (""). I don't see how any changes can be made to this without adjusting the core mediawiki files. What I see is that when the 'save' button is pressed, $formData['emailaddress'] is checked. Since this is not present in the POST data, the variable will be NULL. The checks that follow are whether the variable is '' (which it is not) and whether the old emailaddress equals the new emailaddress (also not). It then defaults to set the new emailaddress, so the user his email is gone after pressing the 'save' button. This was in a mode where the emailaddress field is merely viewable and not editable.
Comment on attachment 3303 [details] Add hidden form inputs for checked+disabled checkboxes Thanks for submitting a patch to MediaWiki. Unfortunately I'm going to have to mark this patch as obsolete because it no longer merges into our current code.