Support » Plugin: User Role Editor » Unable to assign default role

  • Hello, we are using User Role Editor in our multi-site instance. On one of the sites, we have set the default role to “author”. However, we still see new users added as subscribers. When I go to settings the default role is still set to “author” but it’s not applying that role to new users. Apparently this has been happening for a while and the site admin has been just manually changing users to author role. I didn’t see any topics covering this issue. We are running latest WordPress core (4.9.8) and the latest URE version as well (4.45). Any suggestions on what I should look at for troubleshooting this?

    Thanks

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • I too have the same kind of issue but on my end i cannot find the set the default role?
    so author whats your recommendation

    • This reply was modified 7 months, 1 week ago by  keshabee.
    Plugin Author Vladimir Garagulia

    (@shinephp)

    Hi @dzarelli,

    Describe how user subscribes to the existing subsite. Do you use some plugin for this purpose?

    When I select ‘Register’ link under the login form I see only 2 options:
    “Gimme a site!” and “Just a username, please.”.

    So I see the only way to subscribe user to the existing site: with admin help, when he uses “Users->Add New” menu item at wp-admin of selected subsite.
    WordPress pre-selects the default role for a new user correctly at “Add New User” page.

    Plugin Author Vladimir Garagulia

    (@shinephp)

    Hi @keshabee,

    You can see the ‘Default Role’ option for the subsite under WordPress multisite this way:
    – go to subsite wp-admin and open ‘Users->User Role Editor’, use “Defautl Role” button.
    – go to Network Admin->Sites, select subsite in the list of sites, click ‘Edit’ link under it and select “Settings” tab, scroll down to the “Default Role” field.

    Plugin Author Vladimir Garagulia

    (@shinephp)

    User Role Editor only changes the primary default role for the site, assigns the same default role to a new registered subsite as the main site has.
    The rest WordPress does itself or with some plugin help.

    @shinephp Thanks for the response. Users can manually subscribe to blogs or, if they sign in to wp-login or wp-admin using their domain account they are automatically registered using the WpDirAuth (directory authentication) plugin. If they are manually added using the plugin listed above a role can be selected for them. I noticed that under my network admin under /network/settings.php?page=settings-user-role-editor.php there is a check box for “Other default roles for new registred user” and it gives checkbox options for “Author, Contributor, and Editor”. None of these were checked. Should I check the “author” box? Does this mean all new users for all blogs will be given author rights? or is this just saying it will allow subsites to add users as Author of they are configured to do so?

    Plugin Author Vladimir Garagulia

    (@shinephp)

    @dzarelli
    “Other default roles” from URE settings page is used to assign to a new user roles in addition to the site default primary role. WordPress (new user page and API) uses default role value when role is not set for a new user apparently.

    Users can manually subscribe to blogs

    Is it WordPress multisite built-in functionality? If ‘Yes’, can you give me a hint, where and how it works? If ‘Not’ what plugin is in use?

    When I look in URE settings I only see a “default role” button. I don’t see anything that says “Other default roles”. Where is this? As far as I know we are using the built in WordPress functionality for manual subscribers. A “subscribe” button shows on some blog pages. Other pages automatically register you if you login using the WpDirAuth plugin. I would go ahead and list all installed plugins, but there are almost 100 of them. Note that I believe the default role of author was being applied until a few months back. I’m not sure what changed and the site owner took months to notify me of this. I would be happy to supply you with any additional data you might require.

    Please note – I did just try to set the default role to “subscriber”, then back to “Author” and I noticed this message flashed at the top of the page briefly –
    Error! Error encountered during default role change operation

    I tried to enable debug logging, but when I added the debug parameters to the wp-config.ini the site wouldn’t display until I disabled debug logging.

    Plugin Author Vladimir Garagulia

    (@shinephp)

    I answered about this setting, which you noted at the previous message:

    I noticed that under my network admin under /network/settings.php?page=settings-user-role-editor.php there is a check box for “Other default roles for new registred user” and it gives checkbox options for “Author, Contributor, and Editor”.

    About “subscribe” button on the blog page. May be your theme adds and realize this? I need to try this functionality to understand, from where user receives a role not equal to the default one for this site.

    You can see error message when play with ‘default role change’ inside URE in case when you try to set as a new default role the older one. WordPress update_option() returns false in this case:

    
    /*
    	 * If the new and old values are the same, no need to update.
    	 *
    	 * Unserialized values will be adequate in most cases. If the unserialized
    	 * data differs, the (maybe) serialized data is checked to avoid
    	 * unnecessary database calls for otherwise identical object instances.
    	 *
    	 * See https://core.trac.wordpress.org/ticket/38903
    	 */
    	if ( $value === $old_value || maybe_serialize( $value ) === maybe_serialize( $old_value ) ) {
    		return false;
    	}
    

    It seems that checking result of update_option() in this case and show error message does not have sense. I will remove it at all probably.

    dzarelli

    (@dzarelli)

    Thanks for the reply, in most cases users are automatically added as a subscribers when they login using their domain credentials. As I said, we use WpDirAuth plugin for that. There are many sites in our instance but the one we really need to change the default role for uses the above mentioned method for assigning roles.

    You can see error message when play with ‘default role change’ inside URE in case when you try to set as a new default role the older one.

    I’m not quite sure I understand what I need to do to fix this error, I apologize. Could you please explain more?

    Thank you!

    Plugin Author Vladimir Garagulia

    (@shinephp)

    You do not need to do something to fix a mentioned default role update error message. Just wait the next update of User Role Editor. I included a fix for this issue into a version 4.46. I plan to publish it tomorrow.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Unable to assign default role’ is closed to new replies.