Automattic / sensei

Sensei LMS - Online Courses, Quizzes, & Learning
https://senseilms.com
GNU General Public License v2.0
530 stars 197 forks source link

WC Paid Courses: Preview setting for a lesson is ignored when the course access expired #7630

Closed merkushin closed 1 month ago

merkushin commented 1 month ago

Steps to Reproduce

  1. Install WCPC 4.24.1.1.24.0.
  2. Go to Sensei LMS > Courses.
  3. Create a course with 3 lessons (add some content to lessons).
  4. Set the expiration period for the course.
  5. Publish the course.
  6. Go to one of the lessons, add a quiz for it, and enable Preview setting in the sidebar.
  7. Update the lesson.
  8. Make sure you can see the lesson content in the Incognito mode.
  9. Create a student user.
  10. Complete the course with this user.
  11. As an admin, go to Students, find the test course.
  12. Update the Access Expiration for the student, so that the access is expired now.
  13. As a student, go to the lesson with the Preview setting enabled.

What I Expected

I expect to see the lesson content. And the results of the quiz are also available.

What Happened Instead

Content is not available.

PHP / WordPress / Sensei LMS version

WCPC 4.24.1.1.24.0.

Context / Source

8488916-zd-a8c

The issue was probably introduced here: https://github.com/Automattic/sensei-pro/pull/2562/files#diff-b22fdd93fbf63f8a7e3bc3315e1a114c93832dcea88b1eddd2f9eaae3a66b286R107

github-actions[bot] commented 1 month ago

Support References

This comment is automatically generated. Please do not edit it.