• Clicked to view a Leardash Group in Dashboard, Removed Course from it and submitted and BuddyPress errored out with the below. I have dug into the code and it “look” like the third unused $remove parameter than function expects is not passed when the add_action is setup in bp-learndash-loader.php (60,78). I’d prefer not to modify the plug code myself as it will probably break on plugin update… please can you advise.

    The function:
    =============
    public function remove_user_course_group_access( $course_id, $group_id, $remove ) {

    The add_action:
    ===============
    add_action( ‘ld_removed_course_group_access’, array( $this, ‘remove_user_course_group_access’ ), 10, 3 );

    The error:
    ==========
    PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function BuddyPress_LearnDash_Loader::remove_user_course_group_access(), 2 passed in C:\inetpub\wwwroot\learning.live\wp-includes\class-wp-hook.php on line 298 and exactly 3 expected in C:\inetpub\wwwroot\learning.live\wp-content\plugins\buddypress-learndash\includes\bp-learndash-loader.php:585
    Stack trace:
    #0 C:\inetpub\wwwroot\learning.live\wp-includes\class-wp-hook.php(298): BuddyPress_LearnDash_Loader->remove_user_course_group_access(‘234’, 779)
    #1 C:\inetpub\wwwroot\learning.live\wp-includes\class-wp-hook.php(323): WP_Hook->apply_filters(NULL, Array)
    #2 C:\inetpub\wwwroot\learning.live\wp-includes\plugin.php(453): WP_Hook->do_action(Array)
    #3 C:\inetpub\wwwroot\learning.live\wp-content\plugins\sfwd-lms\includes\ld-groups.php(1358): do_action(‘ld_removed_cour…’, ‘234’, 779)
    #4 C:\inetpub\wwwroot\learning.live\wp-content\plugins\sfwd-lms\includes\ld-groups.php(479): ld_update_course_group_access(‘234’, 779, true)
    #5 C:\inetpub\wwwroot\learning.live\wp-con in C:\inetpub\wwwroot\learning.live\wp-content\plugins\buddypress-learndash\includes\bp-learndash-loader.php on line 585

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Fatal error removing course from group’ is closed to new replies.