The module was showing an extra checkbox (without any title) when I don't select all the roles to be displayed in the registration form.

We have been working on that:

 foreach($display_roles as $role){
    $role_name=db_result(db_query("SELECT name FROM {role} WHERE rid=%d",$role));
    
    if(in_array($role,$approval_roles)  and ($role_name!='')){
    $role_name.=" <i>*needs administration approval</i>";
    }
    $roles[$role]=$role_name;
    }
    
    foreach($roles as $role){
        if($role == ''){
            unset($roles[$role]);
        }
    }

;)
I attach the .module file

CommentFileSizeAuthor
#5 extra_blank_role_solved-1470272-1.patch1.09 KBtoni04

Comments

antoniotorres’s picture

I just used an array_pop, hehehe. This is much better.

Pepper’s picture

The above code doesn't work for me, but this did:

if (trim($role_name) != "") {
if(in_array($role,$approval_roles)){
$role_name.=" *needs administration approval";
}
$roles[$role]=$role_name;
}
}
toni04’s picture

Issue summary: View changes
Status: Patch (to be ported) » Fixed

Patch ported, problem solved.

tamerzg’s picture

Status: Fixed » Needs work

Toni04 please put patch here.

toni04’s picture

StatusFileSize
new1.09 KB

Patch upload.

toni04’s picture

Patch upload.

tamerzg’s picture

Status: Needs work » Patch (to be ported)
tamerzg’s picture

Status: Patch (to be ported) » Fixed

Patch applied.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.