• Resolved eventualo

    (@eventualo)


    Hi,
    I’ve an issue with multisite installations with mapped domains (using WordPress MU Domain Mapping).
    When I try to save URE settings on a blog with mapped domain, the URE settings are not saved. There isn’t any notice.

    Steps to reproduce:

    1. login in a blog with mapped domain: e.g. the original WP url is blog-1.example.com, the mapped domain is blog-1.com
    2. visit the URE setting page: e.g. https://www.blog-1.com</wp-admin/users.php?page=users-user-role-editor.php
    3. If you change some options and save, nothing is saved.

    I’ve found a potential cause. Following the above example, even if the URE admin url is “www.blog-1.com</wp-admin/users.php?page=users-user-role-editor.php”, the action attribute of URE form uses the original not-mapped url:

    <form id="ure_form" method="post" action="https://blog-1.example.com/wp-admin/users.php?page=users-user-role-editor.php">

    If I manually change the action url using browser console and then save settings, the changes are saved.

    I see in plugin code (https://plugins.trac.www.ads-software.com/browser/user-role-editor/tags/4.58.3/includes/classes/editor.php#L1311) that the action attribute uses a constant URE_WP_ADMIN_URL:

    <form id="ure_form" method="post" action="<?php echo URE_WP_ADMIN_URL . URE_PARENT . '?page=users-' . URE_PLUGIN_FILE; ?>" >

    URE_WP_ADMIN_URL is defined early in https://plugins.trac.www.ads-software.com/browser/user-role-editor/tags/4.58.3/includes/define-constants.php#L12.

    If I replace URE_WP_ADMIN_URL with admin_url(), the mapped domain is properly printed:

    <form id="ure_form" method="post" action="<?php echo admin_url() . URE_PARENT . '?page=users-' . URE_PLUGIN_FILE; ?>" >

    Maybe URE_WP_ADMIN_URL is defined too early, before that the filters by Domain Mapping are applied.
    Please can you have a look at it? Thanks!

    • This topic was modified 4 years ago by eventualo.
    • This topic was modified 4 years ago by eventualo.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Vladimir Garagulya

    (@shinephp)

    Good point! Thank you for the detailed report.
    I will include a fix to the next update.

    Plugin Author Vladimir Garagulya

    (@shinephp)

    Hi,

    I prepared updated version 4.59 to publishing. It includes the related update:

    * Update: PHP constant URE_WP_ADMIN_URL was replaced with direct ‘admin_url()’ call to respect the ‘admin_url’ filter applied by the get_admin_url() WordPress API function.

    It is available currently as development version from the bottom of Advanced View. It would be good if you test it.

    Thread Starter eventualo

    (@eventualo)

    Sorry for delay. Now it works on that multisite.
    Thank you very much!

    Plugin Author Vladimir Garagulya

    (@shinephp)

    No problem. Thanks for the confirmation.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Settings not saved: maybe issue with Domain Mapping?’ is closed to new replies.