gocodebox / gocodebox/lifterlms

[Instructor Meta Box, Mine Post Table Filter] Default instructor information doesn't get saved with blocks

Open
#937 1 comment 0 reactions 1 assignee Assigned to @thomasplevy View on GitHub
Status: Has PR Type: Bug
Dominant language
PHP
Stars
212
Forks
140
Avg merge
2d 14h
Merged PRs (30d)
19

Description

I was investigating an issue with the Mine(%d) filter on the posts table for course and membership post types and found
https://github.com/gocodebox/lifterlms/blob/master/includes/admin/post-types/post-tables/class.llms.admin.post.table.instructors.php#L106-L123

It expects all the instructors from the metadata and doesn't consider author information.

This led me to
https://github.com/gocodebox/lifterlms/blob/09c3353aaeb2a8785868f2cf1cf67c4146e94068/includes/models/model.llms.post.instructors.php#L118-L152

where the author was supposed to be added as an instructor. This is called via AJAX here:
https://github.com/gocodebox/lifterlms/blob/09c3353aaeb2a8785868f2cf1cf67c4146e94068/includes/class.llms.ajax.handler.php#L206

through
https://github.com/gocodebox/lifterlms/blob/09c3353aaeb2a8785868f2cf1cf67c4146e94068/includes/models/model.llms.post.instructors.php#L154-L174

Since the block editor experience removes the instructor metabox
https://github.com/gocodebox/lifterlms-blocks/blob/master/includes/class-llms-blocks.php#L135-L154

and handles it through the block editor, if instructor information isn't explicitly edited, the default author information doesn't get saved as that of an instructor, leading to the Mine filter to fail.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.