Jump to content

'the guest role is required' error when saving new user


diogo
 Share

Recommended Posts

This message also irritates you?

I did a small change on the file ProcessUser.js to get rid of it. This simply checks and disables the box with javascript.

edit: something went wrong, and ths is not working. i will investigate why

$(document).ready(function() {
    if($("#Inputfield_id").val() == 40) {
        // guest user
        // hide fields that aren't necessary ehre
        $("#wrap_Inputfield_pass").hide();     
        $("#wrap_Inputfield_email").hide();    
        $("#wrap_Inputfield_roles input").attr('disabled', 'disabled');
        //$("#wrap_submit_save").remove();
    }
    // Check and disable the 'guest' role checkbox
    $("#Inputfield_roles_37").prop({
                                    checked: true,
                                    disabled: true
                                });
});

edit: Ok, solved. Apparently disabling the box prevents it's value to be saved also. I went around it like this:

$(document).ready(function() {
    if($("#Inputfield_id").val() == 40) {
        // guest user
        // hide fields that aren't necessary ehre
        $("#wrap_Inputfield_pass").hide();     
        $("#wrap_Inputfield_email").hide();    
        $("#wrap_Inputfield_roles input").attr('disabled', 'disabled');
        //$("#wrap_submit_save").remove();
    }
    // Check and disable the 'guest' role checkbox
    $("#Inputfield_roles_37")
        .prop({
            checked: true
        })
        .css({
            opacity: 0.5
        })
        .click(function(){
            return false;
        });
});
 
Link to comment
Share on other sites

When/where are you guys seeing the 'guest role required' message? Just wondering if this is something that should be fixed in the core ProcessUser module? I guess I haven't noticed this before. 

Link to comment
Share on other sites

I don't think it should be fixed in the module. The behavior is correct and it's good that guest is on the list so it's absence doesn't confuse people. Because I consider this a small annoyance, IMO the best place to fix it is javascript.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...