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: Call to undefined function pmpro_has_membership_access #63

Open
3 tasks done
ipokkel opened this issue Oct 27, 2023 · 0 comments
Open
3 tasks done

Comments

@ipokkel
Copy link
Member

ipokkel commented Oct 27, 2023

Describe the bug
A user reported that the fatal error Call to undefined function pmpro_has_membership_access() in /path_to_root/wp-content/plugins/pmpro-courses/includes/courses.php:209 was triggered on their site.

This would occur if the PMPro core plugin is not active.

The courses add-on uses the pmpro_has_membership_access function and the pmpro_membership_content_filter, pmpro_has_membership_access_filter, and pmpro_after_all_membership_level_changes hooks in various places. All these depend on the PMPro core plugin being active.

To Reproduce
Steps to reproduce the behavior:

  1. Create a course and restrict it to all membership levels
  2. Deactivate the Paid Memberships Pro core plugin
  3. Navigate to the frontend course page as a non-logged-in user in an incognito/private browser window
  4. See error

Expected behavior
No fatal errors should be triggered when PMPro core is deactivated.

Isolating the problem (mark completed items with an [x]):

  • I have deactivated other plugins and confirmed this bug occurs when only Paid Memberships Pro plugin is active.
  • This bug happens with a default WordPress theme active, or Memberlite.
  • I can reproduce this bug consistently using the steps above.

WordPress Environment

Paid Memberships Pro 2.12.3
PMPro Courses 1.2.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant