strangerstudios/pmpro-courses

Updating to PMPro courses 1.2.2 breaks existing links

Closed this issue · 3 comments

Describe the bug
Updating PMPro Courses to 1.2.2 causes existing lesson URLs to change. The lesson post type slug is rewritten to pmpro_lesson .

This can be problematic if you have previously shared lesson links or hardcoded them somewhere.

To Reproduce
Steps to reproduce the behavior:

  1. Install an older version of PMPro Courses eg. 1.2.1
  2. Create a course and add a lesson.
  3. Visit the course page and make note of the lesson URL.
  4. Update to PMPro Courses 1.2.2
  5. Visit the lesson URL from Step 3, observe 404

Expected behavior
Pre-existing lesson URLs still lead to the lesson page.

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

PMPro 2.11.2 PMPro Courses for Membership 1.2.2 WP 6.2.2

To add a note here for others that may come across this issue, I had replicated it at one point but then it cleared itself.

It's worth trying the following:

  • Deactivate (but do not delete) and re-activate the pmpro-courses plugin to flush rewrite rules.
  • Change modules (toggle between modules save and choose your previous module and save again).

Also deactivating the conflicting LMS plugin solves things, you should really only use one LMS plugin on a site that shares courses and lesson slugs.

I think this bug here was the issue: e95bc59

I will do some more testing and push out a point release ASAP.