Change WordPress user roles and capabilities Forums Bug Reports Can't Edit Roles via Subsite

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #1859
    farmzone.net
    Participant

    Hi, I have the URE Pro 4.21.

    I went to go and edit the Admin Menu access for a Role in one of my subsites, but when I click on the role to edit, the page refreshes and shows the Subscriber role.

    No matter what I do I cannot get it to go to a role other than the default.

    #1860
    Vladimir
    Keymaster

    Hi,

    Check the browser JavaScript console for the error messages (Shift+Ctrl+J at Google Chrome).

    #1861
    farmzone.net
    Participant

    Nothing to report. Empty.

    I did the Shift+Ctrl+J then changed the role on the User Role to Administrator editor page. Page refreshed and it was back to Subscriber role with the subscriber settings.

    #1862
    farmzone.net
    Participant

    Just did some more testing to see where the problem may be.

    I run a local DEV server = Works fine.
    I then upload to a staging site (which is a subdomain of master site) = Works
    I then upload to the Master site = Broken

    In regards to the database, it only ever comes down from master to staging or master to dev.

    The ONLY difference with the Master site is CloudFlare and SSL. I have tried disabling CloudFlare to see if it is something there but was getting same results.

    #1863
    farmzone.net
    Participant

    Just think I found something.

    I tried testing with ClouFlare in Dev mode and using Chrome Icognito to eliminate cache issues.

    The URL for the page is here: https://oranamodels.com/wp-admin/users.php?page=users-user-role-editor-pro.php

    I logged in and changed the role ready to edit.

    I was then asked to sign in again, but the URL this time was:
    https://eangulus.com/oranamodels/wp-login.php?redirect_to=https%3A%2F%2Feangulus.com%2Foranamodels%2Fwp-admin%2Fusers.php%3Fpage%3Dusers-user-role-editor-pro.php&reauth=1

    I am using Multisite with Domain Mapping, I didn’t expect that page to use the eangulus.com domain.

    #1864
    Vladimir
    Keymaster

    1) Did you try to change current role to one from the WordPress built-in set, like ‘author’?

    2) What plugin do you use for the domain mapping?
    At this plugin
    https://wordpress.org/plugins/wordpress-mu-domain-mapping/
    description I found:

    The login page will almost always redirect back to the blog’s original domain for login to ensure the user is logged in on the original network as well as the domain mapped one

    So it seems that it’s not the real reason of a problem.

    3) Could you add this line

    
    print_r($_POST);
    

    to the begin to of ‘editor()’ function at user-role-editor-pro/includes/class-ure-lib.php, line #252?

    So it will be seen as:

    
    public function editor() {
    
            print_r($_POST);
            
            if (!$this->editor_init0()) {
    

    When plugin works correct you should see this output after role change:
    Array ( [action] => role-change [object] => role [user_role] => test_copy [ure_nonce] => c82168f082 )

    #1865
    farmzone.net
    Participant

    1. Yes. I have tried. I only have 2 custom roles and have tried also changing to Editor Administrator etc.

    2. Yes. That’s the plugin I use, but also found a similar issue regarding URL’s with WP Legal Pages. They had a drop list that was populating with the Network address instead of the mapped domain, which caused issues with the cookies.’

    3. Done. Result: Array ( )

    #1866
    Vladimir
    Keymaster

    Thanks.
    It seems some redirects took place before you get the URE’s page and it does not get needed POST parameters, similar to the initial opening.

    What will be if you try temporally update the available role ‘subscriber’? Turn on some uncritical capability, like ‘read_private_pages’ and click ‘Update’ button. Will you see the same ‘array()’ output?

    #1867
    farmzone.net
    Participant

    Same result. I think something is happening (or not) before changing anything.

    I noticed when I went to the page, human readable was off (I have it on by default), and when I tried changing it same thing happened. And never got anything in the array.

    I do still think it has to do with the URL. Dev and staging both use the staging.eangulus.com/oranamodels/ format while the main has the mapped domain and redirects the sub Directory to the mapped domain.

    I noted the only difference above but forgot to mention that the domain mapping has all domain info on all 3 sites, but is set as primary domain only in the master for obvious reasons.

    #1868
    farmzone.net
    Participant

    Would it be easier to login for yourself? Only thing is it is a live site, but I only have access at this stage (till I get this bug fixed). And I will have to make any changes back into develop branch so I can push thru Github properly.

    #1869
    Vladimir
    Keymaster

    Thanks for the additional information.
    1st, I will try to setup multisite with domain mapping locally 1st and try to catch a reason.

    Then I will contact you with results and may be ask you about the on-line access if needed.

    #1877
    Vladimir
    Keymaster

    I’ve setup test instance of WordPress multisite with domain mapping locally. But it did not repeat this issue. URE works as expected from any domain (primary or mapped) in URL.

    Send superadmin login credentials to [email protected]
    I will look on the site settings, make some tests on-line.

    I suppose that moving the part of parameters responsible for the presentation, from the POST to GET (adding to URL) may resolve the issue. It depends if redirect takes place after POST data was really processed by plugin code. And it will not help if redirection occurs before POST data processing by URE plugin.

    It’s not a quick fix and will require some time to refactor the code any way.

    #1878
    farmzone.net
    Participant

    Just sent them then.

    Also just note that only the oranamodels site us live at this stage and I am the only active user as well.

    #1879
    Vladimir
    Keymaster

    After you mapped subsite to the different domain, you need to replace its “Site URL” with that domain in order to exclude extra redirections made by WordPress. Go to the ‘Network admin->Sites’, select the site and click ‘Edit’ under its row to get needed form.

    I did that for https://yourgigguide.com/ site and URE started working as expected for that site. Please test.

    #1880
    farmzone.net
    Participant

    Is there anything other way?

    If I do that it would mean alot of extra work scanning and replacing database values to make it work with the dev and staging servers.

    Also this problem wasn’t there before. This site is a rebuild and the old one I never changed the site URL ever, yet didn’t have this issue with ure.

Viewing 15 posts - 1 through 15 (of 17 total)
  • You must be logged in to reply to this topic.