The MU forums have moved to WordPress.org

array_merge() warnings in capabilities.php (48 posts)

  1. beduino
    Member
    Posted 13 years ago #

    Well I test bluee solution and donncha solution and all works ... how odd!
    tks
    beduino

  2. paynehd
    Member
    Posted 13 years ago #

    I posted a few weeks back about not know where to add the "false" statement and the reply was to look in the wp-includes directory for the file...

    Yet, even though I did and auto upgrade to 2.7.1, when I look in the wp-includes directory, there is no wpmu-functions.php file.

    I logged in as admin and when to the dashboard General Settings and down at the bottom right of the page the version shows 2.7.1.

    So now what?

    Can anyone help out?

    Thanks,
    Payne

  3. bmemor21
    Member
    Posted 13 years ago #

    Bluee's solution worked for me too! Perhaps someone can let Donncha know? I think that there is a bug-tracking system somewhere...

  4. andrea_r
    Moderator
    Posted 13 years ago #

    He already knows, it was already fixed in trac.

  5. bforchhammer
    Member
    Posted 13 years ago #

    More or less that is; current trunk holds a workaround which disables the function using it... http://trac.mu.wordpress.org/ticket/998

  6. ctsttom
    Member
    Posted 13 years ago #

    Thanks for fixing this issue, it was such a pain in the ass not being able to post FLASH/IFRAMES.

  7. Chalk
    Member
    Posted 13 years ago #

    I have had this problem for some time now, it has not been a priority for us admins since we are the only ones affected, however, looking closer at the issue this seems to be due to incorrect values being stored in the array_merge

    The original code (wpmu-functions.php line 1975):
    $user->{$cap_key} = array_merge(array( 'administrator' => '1' ), (array)$user->{$cap_key});

    Changed to:
    $user->{$cap_key} = array_merge(array( 'administrator' => '1' ), array($user->{$cap_key}));

    Solves the problem.

  8. carlosvarela
    Member
    Posted 13 years ago #

    Thanks bluee

    find:
    $user->{$cap_key} = array_merge(array( 'administrator' => '1' ), (array)$user->{$cap_key});

    replace:
    $user->{$cap_key} = array_merge(array( 'Administrator' => '1' ), (array)$user->{$cap_key});

  9. monpelaud
    Member
    Posted 13 years ago #

    It seems that this issue was not fixed in wpmu 2.8.2.

  10. SteveAtty
    Member
    Posted 13 years ago #

    Well why not submit it to trac, that way it will get fixed properly.

  11. josswinn
    Member
    Posted 13 years ago #

    There's already a ticket, which I've reopened because I can't see that the change has been made in 2.8.2

    http://trac.mu.wordpress.org/ticket/1038

  12. donncha
    Key Master
    Posted 13 years ago #

    The Administrator change isn't the correct way to fix it as that role doesn't exist. I can't replicate the problem though, even after installing the unfiltered_html plugin.

  13. moose123
    Member
    Posted 13 years ago #

    After reading this thread and making the change based on the trac ticket, could someone confirm that I have this correct?

    $user->{$cap_key} = array_merge(array( 'administrator' => '1' ), array($user->{$cap_key}));
        return false;
    }

    The part I'm not sure of is the return false. I changed the return from true to false based on the ticket, which says "If the typo fixed is return false, changeset 1764 workaround needed? " but I'm not sure what that means, so any confirmation or correction would be great. I am no longer seeing the original error.

    I appreciate your help.

  14. SteveAtty
    Member
    Posted 13 years ago #

    What version of WPMU are you running? I'm surprised if this is isn't fixed in the latest release.

  15. moose123
    Member
    Posted 13 years ago #

    SteveAtty,

    I am running 2.7.1 (db 9872). The error occurred after adding a user (set as Editor) via Admim > edit > Add a new user.

    Thanks.

  16. ctsttom
    Member
    Posted 13 years ago #

    Does anyone know if this has been fixed as I haven't had the issue since 2.8.3

  17. superdavetrey
    Member
    Posted 12 years ago #

    Great! It worked for me too. Thanks.

  18. puppylove
    Member
    Posted 12 years ago #

    I'm using version 2.9.2 but cannot locate any of the codes listed above in my wpmu-functions.php file. Is there a new fix?

    Thank you,

    Lucy

About this Topic

  • Started 13 years ago by bforchhammer
  • Latest reply from puppylove