WordPress.org

Ready to get started?Download WordPress

Forums

Moderator Role
[resolved] in_array Error (15 posts)

  1. SlothLoveChunk
    Member
    Posted 1 year ago #

    Hello, first off, great plug-in.

    Just a heads up that with the latest BuddyPress 1.6 trunk this plug-in now triggers the following error:

    Warning: in_array() expects parameter 2 to be array, null given in "/wp-content/plugins/buddypress/bp-core/bp-core-caps.php on line 414"

    This error only appears when a user is logged in and has the "Moderator" role assigned (i.e. it doesn't appear for admins, editors, authors, subscribers, or any other built-in role). The error shows in the comment admin and comment stream and repeats for each comment.

    I know plug-ins conflict, but since BuddyPress is a pretty common one and is due for a big update soon I thought it was worth notifying you.

    Thanks again!

    http://wordpress.org/extend/plugins/baw-moderator-role/

  2. Julio Potier
    Member
    Plugin Author

    Posted 1 year ago #

    Ok thank you
    I check both codes and i do not understand why "caps" for "moderator" can be something else than array :|
    But thank you for pointing me this !

  3. camay123
    Member
    Posted 1 year ago #

    I get an error similar to this:

    Warning: array_diff() [function.array-diff]: Argument #1 is not an array in /home/.../public_html/wp-content/plugins/contact-form-7/includes/capabilities.php on line 12

    Only visible in the moderator account.

    the error is repeated a few times on top of the comments list.

    Thanks

  4. Julio Potier
    Member
    Plugin Author

    Posted 1 year ago #

    plugins/contact-form-7

    Not mine :/

  5. camay123
    Member
    Posted 1 year ago #

    I understand, but only when I use YOUR plugin that I have this error. I just tried another plugin for moderator role and it its working ok, but shows to much of the control panel.

    Anyhow, ill have to use something else I guess.

  6. Julio Potier
    Member
    Plugin Author

    Posted 1 year ago #

    ok try to change this :
    add_filter('map_meta_cap', 'bawmro_map_meta_cap', 10, 4 );
    and play with "4", try "1" and try "9999"
    Feedback me thanks

  7. camay123
    Member
    Posted 1 year ago #

    In functions.php I should add this ?

  8. Julio Potier
    Member
    Plugin Author

    Posted 1 year ago #

    No directly on my plugin, i dont have free time to do it and test this sorry

  9. camay123
    Member
    Posted 1 year ago #

    If I put "1" I get errors at activation of plugin, and if I put 9999 I get no errors. I can login as the comment moderator, but the user can only edit the profile and see comments. nothing else.

  10. Julio Potier
    Member
    Plugin Author

    Posted 1 year ago #

    ok so, let's go with "4"
    2 lines above, replace "return null;" with "return array();"
    Thanks

  11. camay123
    Member
    Posted 1 year ago #

    set back to 4
    replaced return null with return array();

    no more errors in user moderator account but doesnt have the edit capabilities for comments nor the comment section in the left sidebar.

    Can only see the list of recent comments in dashboard.

    Thanks alot for your time in advance.

  12. Julio Potier
    Member
    Plugin Author

    Posted 1 year ago #

    ok, can you try "5" instead of "4" ? If it doesn't work i'll try to give you a php fix to avoid hacking CF7

  13. camay123
    Member
    Posted 1 year ago #

    ok, lets rewind a bit.

    With 4 it worked. I had forgotten to set back the user to a role of "Moderator" and was left to "Comments Moderator" from another plugin.

    So, after changing "return null;" with "return array();" and keeping "4"

    So thanks for the help.

    Greatly appreciated.

  14. Julio Potier
    Member
    Plugin Author

    Posted 1 year ago #

    So it works now or not ? ^^

  15. Marcus
    Member
    Posted 1 year ago #

    Hello,

    yes, moderation (deleting, editing, ...) is working and no error appears.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic