Settings not saved: maybe issue with Domain Mapping?
-
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:
- 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
- visit the URE setting page: e.g. https://www.blog-1.com</wp-admin/users.php?page=users-user-role-editor.php
- 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
withadmin_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!
- The topic ‘Settings not saved: maybe issue with Domain Mapping?’ is closed to new replies.