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

Fatal error on Sensei_WC::cancel_order #1511

Closed
sjzurek opened this issue Jul 14, 2016 · 2 comments
Closed

Fatal error on Sensei_WC::cancel_order #1511

sjzurek opened this issue Jul 14, 2016 · 2 comments
Labels
Milestone

Comments

@sjzurek
Copy link
Contributor

sjzurek commented Jul 14, 2016

On line 1305 of Sensei_WC::cancel_order
https://github.com/Automattic/sensei/blob/master/includes/class-sensei-wc.php#L1305
Sensei_Utils::sensei_remove_user_from_course method expects second parameter to be product_id, but course_id given instead.

$_product = Sensei_WC::get_product_object( $item_id, $product_type );
// Get courses that use the WC product
$courses = array();
$courses = Sensei()->course->get_product_courses( $item_id );
// Loop and update those courses
foreach ($courses as $course_item){
    if( self::has_customer_bought_product( $user_id, $course_item->ID ) ){
        continue;
    }
    // Check and Remove course from courses user meta
    $dataset_changes = Sensei_Utils::sensei_remove_user_from_course( $course_item->ID, $user_id );
} // End For Loop       
@sjzurek
Copy link
Contributor Author

sjzurek commented Jul 14, 2016

Possibly related to #1508

@sjzurek sjzurek changed the title Fatal error on Sensei_WC::cancell_order Fatal error on Sensei_WC::cancel_order Jul 14, 2016
@danjjohnson danjjohnson added this to the 1.9.7 milestone Aug 10, 2016
@dbtlr dbtlr modified the milestones: 1.9.7, 1.9.8 Aug 25, 2016
@dbtlr dbtlr modified the milestones: 1.9.7, 1.9.8 Sep 6, 2016
@dbtlr
Copy link
Contributor

dbtlr commented Sep 7, 2016

This was fixed in #1512

@dbtlr dbtlr closed this as completed Sep 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants