Closed dwainm closed 8 years ago
Hey there,
SkyVerge developer here working at an issue with Sensei and WooCommerce Memberships: 362744-zd-woothemes
I'm not 100% sure but it seems that Sensei Lessons may trigger save post multiple times resulting in duplicated meta being sent to Memberships restriction rules set in the attached post meta box.
The issue with Memberships only happens with Sensei content and not with other post types where the meta box is attached. While investigating the issue, I found this Sensei issue on GH - does it ring a bell?
Thanks
Hey @unfulvio
My guess would be that because lessons and quizzes are closely linked, when saving a lesson it may trigger save post for both the lesson and quiz simultaneously, which could be causing issues for Memberships.
@dwainm (lead Sensei developer) is on leave until January, but I'll see if there's anyone else available to look into this.
Thanks @danjjohnson, at the moment the issue doesn't really seem to break things (creates 2-3 rules for the same thing and duplicates can be removed from the Membership post type edit screen), but of course it's not optimal and doesn't look good for end users. Will look in the direction you pointed at.
Cheers
Hello folks,
I fear I have to reopen this one: 420589-zd-themes - got a bug report that I was able to reproduce both locally and on my remote test system.
Here's the basic steps I took to reproduce the bug:
Upon creating the Membership rule, it should already appear twice. Alternatively try and remove the Membership rule to no avail.
I have also created a slack channel: #woo-sen-sub-mem - hop in and say hi.
This ticket seems related as well. 420648-zd-woothemes
[EDIT - Removed screencast and shorten link, public repo -- BK]
For 420589-zd-woothemes , https://github.com/Automattic/sensei/blob/master/includes/class-sensei-teacher.php#L87 is the responsible action. I can't get to it today but we need to re-engineer this to do the check without resaving the lesson.
Off the top of my head, filter the lesson save using wp_insert_post_data'
before it gets saved to the db to update the post author to the course author.
Hey @kraftbj :) Could you please give me an update on this issue? Any ETA on when you can have another look at it? Thanks!
hello @kraftbj we still have an open ticket linking to this issue. Any chance we could get an update here? https://woothemes.zendesk.com/agent/tickets/420589
Sorry for the delay @MindyPostoff, @msdesign21 -- didn't see these pings. I'd like the Guardians to confirm my theory, at least, even if they don't the bandwidth for a fix initially.
@danjjohnson any chance we could get an update for the customer here: https://woothemes.zendesk.com/agent/tickets/420589
Wasn't sure if there has been any more progress looping in Guardians or if there is a better person for me to ping?
@kraftbj I can confirm your theory, there is a fix for this in https://github.com/pgk/sensei/commit/cdda5450afeb792dfb16a29c433f3764adbfc9d5 using wp_insert_post_data
as you suggested
Fix merged in #1532
Tested the above fix, and I can confirm that no duplicate rules are created, and the rules can be removed without any problem. cc: @MindyPostoff @msdesign21
Sensei is loaded multiple times. Step through to see how many times The sensei Classes are loaded and how many times new of each class is called. Maybe on ajax calls as well? maybe on track backs