gocodebox / lifterlms

LifterLMS, a WordPress LMS Solution: Easily create, sell, and protect engaging online courses.
https://lifterlms.com
GNU General Public License v3.0
174 stars 134 forks source link

Launching Course Builder after clicking Add Course results in Auto Draft course that disappears #2606

Closed brianhogg closed 2 months ago

brianhogg commented 4 months ago

Reproduction Steps

  1. Click Courses > Add Course
  2. Click Launch Course Builder
  3. Observe title "Auto Draft", add a Section and Lessons, and edit the Title to "Testing Edit" and add a section
  4. Click Save Changes
  5. Return to Courses listing

Expected Behavior

Course is shown is the course listing, and can be edited.

Actual Behavior

Course is not shown in the course listing and disappears.

Error Messages / Logs

No error messages are shown during the reproduction steps, so the user doesn't realize there's a problem until their course is not able to be found.

Captura de pantalla 2024-02-26 a las 3 14 50 p  m

Changes show as successfully saved.

Captura de pantalla 2024-02-26 a las 3 15 42 p  m

The course cannot be found. Going to Courses > Add Course again creates a new course with auto-draft status.



This issue has be recreated:
+ [x] Locally
+ [x] On a staging site
+ [x] On a production website
+ [x] With only LifterLMS and a default theme
brianhogg commented 4 months ago

At some point an actual draft of the auto draft needs to be saved. Perhaps when the course builder is launched, if it's an auto draft, the course can be saved as an actual draft behind the scenes.

brianhogg commented 2 months ago

Was supposed to be fixed in 7.6.0, but it seems to still be showing Auto Draft on initial load of the course builder. Going back then going back into the course builder shows New Course as expected.

brianhogg commented 2 months ago

The issue is the global $post wasn't reloaded after changing the course title to New Course. PR to fix #2642