Revert "Use parent_post_id instead of postmeta joins in HPPS services"#7949
Merged
donnapep merged 1 commit intoApr 22, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Reverts the prior HPPS services change that relied on sensei_lms_progress.parent_post_id, switching tables-based services back to using WordPress postmeta joins (_lesson_course, _lesson_quiz) to relate lessons, courses, and quizzes.
Changes:
- Update tables-based progress/grading services to join through
wp_postmetainstead of usingparent_post_id. - Adjust grading/progress SQL to map lesson→course and lesson→quiz via
_lesson_course/_lesson_quiz. - Update unit tests to align with the reverted behavior (including removing tests that asserted
parent_post_id-based linking).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| includes/internal/services/class-tables-based-progress-clauses-service.php | Reverts course/lesson clauses to use postmeta joins for last activity and days-to-completion. |
| includes/internal/services/class-tables-based-progress-aggregation-service.php | Reverts aggregation queries to find quiz relationships via _lesson_quiz postmeta joins. |
| includes/internal/services/class-tables-based-grading-listing-service.php | Reverts grading listing queries to join quiz progress/submissions via _lesson_quiz postmeta. |
| tests/unit-tests/test-class-grading.php | Updates progress creation calls to omit parent_post_id args. |
| tests/unit-tests/internal/services/test-class-tables-based-progress-aggregation-service.php | Removes test that asserted behavior specifically dependent on parent_post_id. |
| tests/unit-tests/internal/services/test-class-tables-based-grading-listing-service.php | Removes test that asserted behavior specifically dependent on parent_post_id. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
donnapep
added a commit
that referenced
this pull request
May 13, 2026
…ports Mirrors the pattern restored by PR #7949 across the other HPPS services: quiz progress rows are located via the lesson's _lesson_quiz postmeta, and lesson-to-course aggregation goes through _lesson_course postmeta instead of relying on lesson progress rows' parent_post_id. Six queries in Tables_Based_Reports_Listing_Service updated: get_lesson_students, get_course_students, get_user_lesson_progress, get_user_courses, get_lesson_completion_count, get_lesson_average_grade. Two existing tests now set _lesson_quiz on the lesson post since Sensei_Factory::quiz->create() does not write that meta automatically; the new query path requires it to find the quiz progress row. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reverts #7930 based on this discussion - #7931 (comment).