WordPress.org

Ready to get started?Download WordPress

Forums

User Role Editor
[resolved] CRITICAL: saving settings breaks all s2Member access checks (11 posts)

  1. topsitemakers
    Member
    Posted 1 year ago #

    Hello,

    Saving URE settings for any role completely breaks s2Member custom roles and capabilities.

    This is the most critical issue for all websites using User Role Editor and s2Member.

    Steps to reproduce the issue:

    1. clean WordPress 3.5.1 install with s2Member (v130406) and User Role Editor (3.12)
    2. create 2 pages for s2Member and configure the plugin:
      • "Membership options page" - leave empty content
      • "Login welcome page" - add the following content for testing purposes:

        [s2If current_user_can(access_s2member_level1)]
        You can access level 1
        [/s2If]
        [s2If current_user_can(access_s2member_level2)]
        You can access level 2
        [/s2If]
        [s2If current_user_can(access_s2member_level3)]
        You can access level 3
        [/s2If]
        [s2If current_user_can(access_s2member_level4)]
        You can access level 4
        [/s2If]
      • setup s2Member:
        • Admin -> s2Member -> General Options -> Login Welcome Page -> select the new page
        • Admin -> s2Member -> General Options -> Membership Options Page -> select the new page
    3. create a test user and assign any of the s2member levels
    4. login to the site and verify the appropriate "You can access level X" text is displayed on the "Login welcome page"
    5. as administrator go to: Admin -> Users -> User Role Editor, select any of the s2Member levels and just click "Update"
    6. s2Member levels will not be recognized anymore in the system - "Login welcome page" will not show any text for regular user
    7. you must reset s2Member roles and capabilities to rebuild custom capabilities: Admin -> s2Member -> General Options -> Membership Levels/Labels -> Reset Roles/Capabilities.
      This will again break when you re-save URE settings.

    Please provide a fix soonest possible.

    Also, post any ideas that will help us and other developers temporarily fix the issue until the update is released.

    Thank you.

    http://www.topsitemakers.com

    http://wordpress.org/extend/plugins/user-role-editor/

  2. topsitemakers
    Member
    Posted 1 year ago #

    This is probably related to the same issue: all custom capabilities are missing in the latest version of the plugin.

    Screenshots:

    OLD:
    http://s22.postimg.org/fle73tb8h/ure_issue_old.png
    NEW:
    http://s22.postimg.org/w57acbb4x/ure_issue_latest.png

    http://www.topsitemakers.com

  3. Vladimir Garagulya
    Member
    Plugin Author

    Posted 1 year ago #

    Hello,
    Thanks for the signal. I will check.

  4. Vladimir Garagulya
    Member
    Plugin Author

    Posted 1 year ago #

    I installed fresh WP 3.5.1, S2Member 130406 and URE 3.12.
    After repeating steps described above S2Member capability are in place.
    http://shinephp.com/wp-content/downloads/wordpress/s2member-role-update-success.png
    New login with test user is successful. Thus, I could not repeat the issue for this moment. Any additional information which could help to isolate the problem is appreciated.

    Did you clicked 'Reset' button at URE form? It is the only way I could imagine, when custom capabilities could be removed.
    I will check if this function could be executed accidentally, but probability of that plugin works this way is very low.

  5. topsitemakers
    Member
    Posted 1 year ago #

    Thank you for your messages.

    I missed bbPress from the initial list of plugins. Just add and enable it and "Custom capabilities" section will disappear from the URE settings form.

    Also, the "Reset" button was not clicked.

    Note: users can login and see the site, but if any page uses s2Member access checks, it will not work. s2Member simply does not recognize them anymore.

    http://www.topsitemakers.com

  6. Vladimir Garagulya
    Member
    Plugin Author

    Posted 1 year ago #

    Yes, bbPress is the key to the problem. After its activation s2Members capabilities were hidden. After deactivation of bbPress s2Members caps were shown again at Custom caps section, but all are turned off. This is the reason.

    I will investigate how it is related to the URE code which excludes bbPress roles and capabilities from showing at User Role Editor. bbPress creates its roles on the fly, thus there is no sense to edit them and save into DB as URE does for other WP roles stuff.

    Thanks.

  7. topsitemakers
    Member
    Posted 1 year ago #

    OK, thank you for your message.

    Keep us updated please.

    http://www.topsitemakers.com

  8. Vladimir Garagulya
    Member
    Plugin Author

    Posted 1 year ago #

    I found and fixed the issue. Please try this 3.14 Beta version of URE
    http://shinephp.com/wp-content/downloads/wordpress/plugins/user-role-editor-3.14b.zip

    If interested in a reason of problem you met:
    bbPress after returning its own keymaster capabilities list, via filter with bbp_dynamic_role_caps() function adds 'read', 'level_0' and full list of s2Member levels capabilities to its keymaster role. Thus, URE when excluded bbPress caps removed s2Member together with them too :(.
    I filter out non-bbPress caps from this operation now.

    I'll be very thankful if you share your test results.

  9. topsitemakers
    Member
    Posted 1 year ago #

    Thank you for quick update, it seems to be working properly now.

    We tested beta on all previous clean installs + on a completely new install.

  10. Vladimir Garagulya
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks for your help in problem isolation and update testing. I will publish it this week.

  11. topsitemakers
    Member
    Posted 1 year ago #

    You are welcome. Thank you for your responsiveness.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.