From: delfuego-squirrelmail <squ...@li...> - 2008-03-13 18:46:50
|
Doing a bit of Subversion surfing, I think I know where this bug was introduced, and what's causing it. On March 5th, revision 13004 changed functions/options.php to make all boolean option widgets (SMOPT_TYPE_BOOLEAN widgets) default to display as checkboxes rather than radio buttons -- and since there's an HTML difference in a user clearing a checkbox vs. selecting a radio button, SquirrelMail isn't properly handling the unsetting of these preferences. Prior to revision 13004, when a user wanted to turn off an option like "Show HTML Version by Default", it involved choosing the "No" radio button, which submitted a value of 0 for the show_html_default option on the form. >From revision 13004 forward, that option is now a checkbox, so when a user clears the checkbox and submits the form, *no* value is submitted for the show_html_default option. And since include/load_prefs.php file sets the default to SMPREF_ON, with no value submitted by the user, the user ends up with the default value of *on* -- and there's no way to clear the preference anymore. Looking at the various include/options/ files and crossing the SMOPT_TYPE_BOOLEAN widgets with those that back preferences which default to SMPREF_ON, this bug affects the following prefs: * alt_index_colors * collapse_folders * delete_prev_next_display * enable_forward_as_attachment * fancy_index_highlite * include_self_reply_all * mdn_user_support * page_selector * show_flag_buttons * show_html_default * show_only_subscribed_folders * sort_by_ref * strip_sigs For right now, the workaround appears to be to revert functions/options.php at line 627 so that the default for the function createWidget_Boolean is to NOT create them as checkboxes ($checkbox=FALSE) -- this restores the prior functionality. I'd imagine that if the intent is to be able to properly use checkboxes, then the real fix will involve checking to see if a widget is a checkbox on submission, and if so AND if there's no value submitted for the widget, manually setting it to 0 before calling the function that writes the prefs out to file. Jason delfuego-squirrelmail wrote: > > Howdy all -- I just started playing with 1.5.2-cvs (checked out > today), and it appears that there's a bug with the "Show HTML Version > by Default" option, and all other SMPREF_ON-defaulting prefs, in the > Display Preferences. > -- View this message in context: http://www.nabble.com/Bug-with-%22Show-HTML-Version-by-Default%22-%28and-other-SMPREF_ON-default-values%29-in-1.5.2-cvs-tp16034115p16035698.html Sent from the squirrelmail-devel mailing list archive at Nabble.com. |