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

Drip Content Locking Already completed courses when adding a specific date of release #1835

Closed
2 of 4 tasks
nrherron92 opened this issue Oct 22, 2021 · 4 comments · Fixed by #2136
Closed
2 of 4 tasks
Assignees
Labels
Severity: Low Status: Has Alternative A workaround or alternative solution is available Status: Has PR This issue has an open pull request Type: Bug Bugs and errors

Comments

@nrherron92
Copy link
Contributor

Reproduction Steps

  • HS-175521
  • this may be a feature request?
  • Set up a course and have a user complete all of the lessons.
  • Go in and add a drip content to release a lesson on a specific day or a far out number of days from when the user registered

Expected Behavior

  • Since the user already finished the lesson and marked it complete they should be able to still access it despite drip content

Actual Behavior

  • the course gets locked for users who already completed the lesson

Error Messages / Logs

  • Include any relevant error messages or log files
<!-- Paste error logs / backtraces below this line -->

System and Environment Information

System Report
Wordpress
-------------------------------------------

Home Url: https://natalie-test-site.myliftersite.com
Site Url: https://natalie-test-site.myliftersite.com
Login Url: https://natalie-test-site.myliftersite.com/wp-login.php
Version: 5.8.1
Debug Mode: No
Debug Log: No
Debug Display: Yes
Locale: en_US
Multisite: No
Page For Posts: Not Set
Page On Front: Not Set
Permalink Structure: /%postname%/
Show On Front: posts
Wp Cron: Yes


Settings
-------------------------------------------

Version: 5.4.0
Db Version: 5.4.0
Course Catalog: Course Catalog (#35) [https://natalie-test-site.myliftersite.com/courses/]
Membership Catalog: Membership Catalog (#36) [https://natalie-test-site.myliftersite.com/memberships/]
Student Dashboard: Dashboard (#38) [https://natalie-test-site.myliftersite.com/dashboard/]
Checkout Page: Purchase (#37) [https://natalie-test-site.myliftersite.com/purchase/]
Course Catalog Per Page: 9
Course Catalog Sorting: menu_order
Membership Catalog Per Page: 9
Membership Catalog Sorting: menu_order
Site Membership: Not Set
Courses Endpoint: my-courses
Edit Endpoint: edit-account
Lost Password Endpoint: lost-password
Vouchers Endpoint: redeem-voucher
Autogenerate Username: no
Password Strength Meter: no
Minimum Password Strength: 
Terms Required: no
Terms Page: Not Set
Checkout Names: 
Checkout Address: 
Checkout Phone: 
Checkout Email Confirmation: no
Open Registration: no
Registration Names: 
Registration Address: 
Registration Phone: 
Registration Voucher: 
Registration Email Confirmation: no
Account Names: 
Account Address: 
Account Phone: 
Account Email Confirmation: no
Confirmation Endpoint: confirm-payment
Force Ssl Checkout: no
Country: US
Currency: USD
Currency Position: left
Thousand Separator: ,
Decimal Separator: .
Decimals: 2
Trim Zero Decimals: no
Recurring Payments: yes
Email From Address: team+sandbox@lifterlms.com
Email From Name: A LifterLMS Sandbox
Email Footer Text: 
Email Header Image: 
Cert Bg Width: 800
Cert Bg Height: 616
Cert Legacy Compat: no


Constants
-------------------------------------------

LLMS_REMOVE_ALL_DATA: undefined
LLMS_REST_DISABLE: undefined
LLMS_SITE_FEATURE_RECURRING_PAYMENTS: undefined
LLMS_SITE_IS_CLONE: undefined


Gateways
-------------------------------------------

Manual: Disabled
Manual Logging: 
Manual Order: 1


Server
-------------------------------------------

Mysql Version: 5.7.35
Php Curl: Yes
Php Default Timezone: UTC
Php Fsockopen: Yes
Php Max Input Vars: 5000
Php Max Upload Size: 512 MB
Php Memory Limit: 256M
Php Post Max Size: 1024M
Php Soap: Yes
Php Suhosin: No
Php Time Limt: 30
Php Version: 7.3.31
Software: Apache/2.4.51 (Unix) OpenSSL/1.1.1
Wp Memory Limit: 256M


Browser
-------------------------------------------

HTTP USER AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36


Theme
-------------------------------------------

Name: Astra
Version: 3.7.3
Themeuri: https://wpastra.com/
Authoruri: https://wpastra.com/about/
Template: 
Child Theme: No
Llms Support: Yes


Plugins
-------------------------------------------

AutomatorWP: 1.8.3
AutomatorWP - WooCommerce integration: 1.1.1
LifterLMS: 5.4.0
Manage User Columns: 1.0.3
User Switching: 1.5.8
WooCommerce: 5.8.0
Yoast SEO: 17.4


Integrations
-------------------------------------------

BbPress: No
BuddyPress: No


Template Overrides
-------------------------------------------




This issue has be recreated:

  • Locally
  • On a staging site
  • On a production website
  • With only LifterLMS and a default theme

Browser, Device, and Operating System Information

  • Browser name and version
  • Operating System name and version
  • Device name and version (if applicable)
@thomasplevy thomasplevy self-assigned this Oct 22, 2021
@nrherron92
Copy link
Contributor Author

sorry to bump but the customer really wants an answer on this one

@eri-trabiccolo
Copy link
Collaborator

This seems to be a bug but being here since forever I guess if we have users leveraging this, mmm.
Also the same should be applied for other restrictions related to courses or lessons already completed, isn't so?
@thomasplevy what do you think?

@eri-trabiccolo
Copy link
Collaborator

eri-trabiccolo commented Oct 26, 2021

@nrherron92 while we discuss on how to better approach this, do you think it would be possible to relay a snippet that will fix the customer issue for the moment?
You can find it here:
https://github.com/gocodebox/snippets/blob/f3afa245ea1f4ecc1a5f3355e853dfa606782caa/lifterlms/lifterlms-no-lesson-drip-if-completed.php

Thanks!

@thomasplevy
Copy link
Contributor

I think that this is a bit of a weird edge case and it is possible that users are leveraging this bug as a feature...

But... it does feel like a bug to me... I can't see a real reason why someone would want to add drip and intend it to lock out users who have already completed the content.

Thus, I think we could return early with false if the user has already completed the lesson in question, adding that early return here:

$lesson = new LLMS_Lesson( $lesson_id );
if ( $lesson->is_available() ) {

I would add it on 338 before the is_available() check.

We could add a boolean filter on to enable this check (true or on by default) so that if someone is leveraging this bug as a feature we can flip it back on for them with a one-liner:

if ( apply_filters( 'llms_lesson_drip_bypass_if_completed', true ) ) { ... }

Which can be disabled with add_filter( 'llms_lesson_drip_bypass_if_completed', '__return_false )`

This probably isn't essential but we'll thank ourselves later when someone takes issue with the change

@thomasplevy thomasplevy added the Type: Bug Bugs and errors label Oct 26, 2021
@thomasplevy thomasplevy removed their assignment Oct 26, 2021
@thomasplevy thomasplevy added Status: Has Alternative A workaround or alternative solution is available Severity: Low labels Oct 26, 2021
@eri-trabiccolo eri-trabiccolo self-assigned this Apr 20, 2022
@pondermatic pondermatic added the Status: Has PR This issue has an open pull request label Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Severity: Low Status: Has Alternative A workaround or alternative solution is available Status: Has PR This issue has an open pull request Type: Bug Bugs and errors
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants