Group attachment broken when updating course via quick edit
-
When updating course data via Quick Edit, the link between course and it’s group is broken.
## Description
When creating a course, it’s often the case that a BuddyPress group is attached to it. This is normally done by editing the course in the WordPress post edit view which is the default way WordPress posts are edited.
When updating the course this way, the group attachment works fine. You can attach a group to the course and remove it without problem.
Things change when editing the course data (eg. course title) via the Quick Edit action by clicking the Quick Edit link, under the course title in the table of courses.
After saving the changes the course-group attachment is broken ie. there is no longer a link between the course and it’s previously attached group.
This is a bug because quick editing is quietly separates the course from it’s group and there’s no reason for it.
## Expected Behavior
When the course data is edited via Quick Edit, nothing more is changed than the actual data that I’ve changed. Certainly not the link between course and group.
## Actual Behavior
When the course data is edited via Quick Edit, in addition to the changes made by me, the link between course and group is broken.
## Possible Fix
Right now the bug seems to happen in
bp_learndash_save_postdata()
when$_POST['bp_course_group']
is not set.Maybe you could add an input to the regular post edit view which would also have to be checked.
Eg.if(isset($_POST['input_from_post_edit_view']))
## Steps to Reproduce
1. Create a course and attach a group to it
2. Go to the course list view
3. Click the Quick Edit link under the course title
4. Edit the course title
5. Save changes
6. Now the course is not attached to the group anymore## My Environment
* Plugin version used: 1.2.5
* BuddyPress version used: 4.4.0
* Learndash version used: 2.5.8.1
* WordPress version used: 5.2.2
* PHP version used: 7.3.4
- The topic ‘Group attachment broken when updating course via quick edit’ is closed to new replies.