• So, this works great on single installations. On a network, it works with the root site, but not on any additional sites on that network. When you hit ‘Save Changes’ in the settings, the page tries to access the root admin page. Like,

    http://mysite.com/wp-admin/

    instead of what it should be:

    http://mysite.com/subsite/wp-admin/

    Any thoughts on a fix for this? The plugin ticks all the other boxes I need except for this minor thing!

    http://wordpress.org/plugins/underconstruction/

Viewing 11 replies - 1 through 11 (of 11 total)
  • Hi!

    I had the same problem. My fix as diff:

    diff --git a/wp-content/plugins/underconstruction/ucOptions.php b/wp-content/plugins/underconstruction/ucOptions.php
    index 26da6c5..8c62f67 100755
    --- a/wp-content/plugins/underconstruction/ucOptions.php
    +++ b/wp-content/plugins/underconstruction/ucOptions.php
    @@ -151,7 +151,7 @@ if(isset($_POST['required_role'])){
                    <br />
            </div>
            <form method="post"
    -               action="<?php echo 'options-general.php?page=' . $this->mainOptionsPage; ?>"
    +               action="<?php echo $GLOBALS['PHP_SELF'] . '?page=' . $this->mainOptionsPage; ?>"
                    id="ucoptions">
                    <h2><?php _e('Under Construction', 'underconstruction');?></h2>
                    <table>

    Best regards
    Björn

    Hey folks,

    Am having the same problem…not sure I understand this “diff” fix though…copy/paste as is? not familiar with this…help?

    thnx,
    -jennyb

    Hi Jenny!
    There are some tools to apply patches, but in this case it’s not necessary. Edit the file ucOptions.php and replace

    action="<?php echo 'options-general.php?page=' . $this->mainOptionsPage; ?>"

    with

    action="<?php echo $GLOBALS['PHP_SELF'] . '?page=' . $this->mainOptionsPage; ?>"

    Regards
    Björn

    Hey thanks Björn, will give it a go!
    best,
    -jennyb

    Thread Starter Matt Northam

    (@scpgt)

    This just alerted me to the fact that I’d never replied to your original answer Björn.. Thanks for the fix; worked a treat! 🙂

    Looks like this has been written into the latest version! rock n roll 😀

    Hey guys, I’m having the exact problem Matt describes. I have the latest version and can see the edit on line 161 of ucOptions.php Björn kindly offers but am still redirected to the root admin level when I save any changes. Any thoughts would be appreciated?

    @addandam: If you require assistance then, as per the Forum Welcome, please post your own topic.

    This 6 month old topic references an old version of WordPress.

    Also – the plugin has been updated and now works on multisite 🙂

    The patch I posted here doesn’t seem to work anymore. I found a new solution here: http://wordpress.org/support/topic/_serverphp_self-doesnt-work.

    Applied to this plugin means replacing

    <?php echo $GLOBALS['PHP_SELF'] . '?page=' . $this->mainOptionsPage; ?>

    with

    <?php echo esc_attr($_SERVER['REQUEST_URI']); ?>

    in ucOptions.php

    Nice, thanks Bjoerne!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Unable to activate this on a network site’ is closed to new replies.