Thanks for fixing this imediately and for not using
the mailing list.

Your fix http://trac.roundcube.net/changeset/4692
solves the issue.

Nethertheless, I think the script is not too bad.
It saves one useless request to the server.

_________

Maybe that's MySQL related.

I'm faced with 'errorsaving' when I submit
prefs saving request twice and no properties have changed.

The problem is in rcube_user.php ::: line 157 ff.

Looks like ...

     $this->db->affected_rows()

... returns false.

Well, I have not investigated why the request
is taken when saving prefs on inialial load while
same request throws the error when hitting save
button without changes of prefs in the same session.

Here is a tiny javascript function to prevent users
saving prefs when there is nothing to save:


var request_saver_form_str = null;
var request_saver_form_initial_str = false;
var request_saver_initial_load = true;
$(document).ready(function(){
     function request_saver_form_values(){
       var str = $("form").serialize();
       if(str != request_saver_form_str){
         request_saver_form_str = str;
         if(!request_saver_initial_load){
           $('#formfooter').show();
         }
         else{
           request_saver_form_initial_str = str;
         }
         if(str == request_saver_form_initial_str){
           $("#formfooter").hide();
         }
         request_saver_initial_load = false;
       }
     }
     if(rcmail.env.task == 'settings' && rcmail.env.action ==
'edit-prefs'){
       $(":checkbox, :radio").click(request_saver_form_values);
       $("textarea, input").keypress(request_saver_form_values);
       $("select").change(request_saver_form_values);
       $("#formfooter").hide();
       request_saver_form_values();
     }
});


As far as I can see, it works well.


_______________________________________________
List info: http://lists.roundcube.net/dev/
BT/8f4f07cd

Reply via email to