• Resolved Saurabh Chauhan

    (@saurabhpro)


    Hi LearnPress Team,

    I was using this action “learn-press/user-course-finished” and it was triggering correctly from finish_course function in wp-content\plugins\learnpress\inc\user\abstract-lp-user.php:657 (version: 4.2.7.5)

    After last two release, this function is not being called anymore and now there is this new function called handle_finish in wp-content\plugins\learnpress\inc\Models\UserItems\UserCourseModel.php:926 (version: 4.2.7.6+)

    This function has that same hook in the if condition:

    // Hook old
    if ( has_filter( 'learn-press/user-course/finish' ) ) {
    do_action( 'learn-press/user-course-finished', $this->ref_id, $this->user_id, null );
    }

    But I think it should be:

    // Hook old
    if ( has_filter( 'learn-press/user-course/finished' ) ) {
    do_action( 'learn-press/user-course-finished', $this->item_id, $this->user_id, null );
    }

    In this old code, Course ID was being passed as first parameter but now it is passing a $this->ref_id which is a Order ID.

    I want to use that function, is this a mistake or should I adapt my code?

    Are you guys using Slack or Discord?

    Regards,
    Saurabh

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support brianvu-tp

    (@briantp)

    Hi Saurabh Chauhan,

    We appreciate you bringing this to our attention.

    You’re correct in identifying the change in how the Course ID is passed as a parameter. We’ve investigated the issue and have implemented a fix in this LearnPress beta version

    Please install this beta version and test to see if the issue is resolved. Let us know if you have any further questions.

    Best regards,
    Brianvu-tp

    Thread Starter Saurabh Chauhan

    (@saurabhpro)

    Hi Brianvu-tp,

    Thanks for getting back.

    Thanks for the fix. I see that you released an update as well.

    Saurabh

    Plugin Support brianvu-tp

    (@briantp)

    Hi Saurabh Chauhan,

    We are glad to hear that you found the solution useful!

    If you are satisfied with LearnPress, we would greatly appreciate it if you could leave us a 5-star review. A nice rating is a big motivation for us to keep up the hard work, and it’s really important to us.

    Thank you very much for your feedback.

    Best regards,
    Brianvu-tp

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.