Description
When a custom block template is assigned to an individual LearnPress course, lesson and quiz URLs render the course overview instead of the course item. LearnPress still adds its course-item-popup body class, which disables normal page scrolling.
This reproduces with LearnPress 4.4.4 and WordPress 7.0.3 under both Assembler 0.0.29 and Twenty Twenty-Five 1.5. Editing LearnPress's supplied Single Course template works; assigning a separate custom template to the course triggers the problem.
Steps to reproduce
- Activate LearnPress 4.4.4 with a block theme.
- Create a published course containing a lesson or quiz.
- Create a custom block template containing the normal Single Course blocks.
- Assign that custom template to the course.
- Open the course and select its lesson or quiz.
Expected
The lesson, quiz, or protected-content notice appears inside LearnPress's course item layout.
Actual
The URL changes to the lesson or quiz URL, but the custom course overview renders again. The body has course-item-popup and overflow-y: hidden, while the expected #popup-course element is absent.
Cause
WordPress places the course's assigned _wp_page_template first in the single-template hierarchy. GutenbergHandleMain::set_blocks_template() appends SingleCourseItemBlockTemplate but leaves the higher-priority course template in the candidate list, so WordPress selects the overview template.
Test matrix
| Theme |
Assigned course template |
Result |
| Assembler 0.0.29 |
Default |
Course item works |
| Assembler 0.0.29 |
Custom |
Course overview reloads; page cannot scroll |
| Twenty Twenty-Five 1.5 |
Default |
Course item works |
| Twenty Twenty-Five 1.5 |
Custom |
Course overview reloads; page cannot scroll |
The same results occur for logged-in and logged-out requests.
Description
When a custom block template is assigned to an individual LearnPress course, lesson and quiz URLs render the course overview instead of the course item. LearnPress still adds its
course-item-popupbody class, which disables normal page scrolling.This reproduces with LearnPress 4.4.4 and WordPress 7.0.3 under both Assembler 0.0.29 and Twenty Twenty-Five 1.5. Editing LearnPress's supplied Single Course template works; assigning a separate custom template to the course triggers the problem.
Steps to reproduce
Expected
The lesson, quiz, or protected-content notice appears inside LearnPress's course item layout.
Actual
The URL changes to the lesson or quiz URL, but the custom course overview renders again. The body has
course-item-popupandoverflow-y: hidden, while the expected#popup-courseelement is absent.Cause
WordPress places the course's assigned
_wp_page_templatefirst in the single-template hierarchy.GutenbergHandleMain::set_blocks_template()appendsSingleCourseItemBlockTemplatebut leaves the higher-priority course template in the candidate list, so WordPress selects the overview template.Test matrix
The same results occur for logged-in and logged-out requests.