Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I have no idea what is happening.... #100

Open
reloi opened this issue Feb 1, 2013 · 1 comment
Open

I have no idea what is happening.... #100

reloi opened this issue Feb 1, 2013 · 1 comment

Comments

@reloi
Copy link

reloi commented Feb 1, 2013

Hi there, I am not a programmer at all and don't have any knowledge of how PHP works. However, in using the BuddyPress Courseware plugin this error message continuously comes up on group pages under the menu option labeled Courseware:

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/content/92/10013292/html/wp-content/plugins/buddypress-courseware/roles/roles.class.php on line 269

Warning: Invalid argument supplied for foreach() in /home/content/92/10013292/html/wp-content/plugins/buddypress-courseware/roles/roles.class.php on line 271

Please help!

@galakhov
Copy link

I figured same problem by doing so (with get_teachers( $group_id ) function):

function get_teachers( $group_id ) {
    $teachers = array();

    $group_admins = groups_get_group_admins( $group_id );
    $group_members = groups_get_group_members( $group_id );
    //$group_members = array_merge( $group_admins, (array)$group_members['members'] );

    if (isset($group_members['members']) and !empty($group_members['members']))
        $group_members = array_merge( $group_admins, (array)$group_members['members'] );
    else
        $group_members = array_merge( $group_admins, array() );

    foreach ( $group_members as $member )
        if( self::can_teach( $member->user_id ) )
            $teachers[] = $member->user_id;

    return $teachers;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants