sensei icon indicating copy to clipboard operation
sensei copied to clipboard

Learning mode template is broken when trying to edit it through the lesson editor

Open renatho opened this issue 8 months ago • 1 comments

Steps to Reproduce

  1. Install and activate a theme that is not a block theme. Example: Divi.
  2. In the sidebar, select the Learning Mode template.
  3. Click on "Edit".

What I Expected

To be able to edit the template.

What Happened Instead

The template is broken because the blocks are not registered.

Questions

Notice that we can only edit the template there if it's not a block theme. Should it also work there for block themes? And should the user be able to change the template there since Learning Mode forces a specific template?

PHP / WordPress / Sensei LMS version

Tested on WordPress 6..5 and 6.7 / Sensei LMS 4.24.5

Browser / OS version

Chrome / Mac OS

Screenshot / Video

https://github.com/user-attachments/assets/263df4d1-c4de-4073-bfaf-dcd559b7cc6d

Context / Source

I think the ideal solution here wouldn't be to restrict where the blocks are registered or not. The ideal solution in my opinion would be to re-think the lesson/template blocks to be the same. It would help to avoid confusion for the users, and this issue wouldn't happen since the blocks should be available on lessons and in the Learning Mode template.

Related PR: https://github.com/Automattic/sensei/pull/7791

renatho avatar Mar 27 '25 19:03 renatho

I just encountered this too, while testing the process for creating a new template.

You can edit the template via Appearance > Editor, but not via the lesson itself.

Note: In my test, when editing a lesson, the template used was "Single Posts". Not sure if that's correct, as it should use the Learning mode template if learning mode is enabled.

danjjohnson avatar Jun 10 '25 12:06 danjjohnson