sensei
sensei copied to clipboard
Error editing Learning Mode templates
Steps to Reproduce
There are 2 ways of reproduce the same error:
Without a bock-based theme:
- Activate Twenty Twenty-One theme (not block-based theme).
- Go to WP Admin > Appearance > Editor.
With a bock-based theme, but with the theme styles disabled:
- Activate Twenty Twenty-Two theme (block-based theme).
- Go to WP Admin > Sensei LMS > Settings > Courses.
- Disable the option "Enable theme styles".
- Go to WP Admin > Appearance > Editor > Browse all templates (this option appears when expanding the "Home >" in the top bar).
- Click on "Lesson (Learning Mode)".
What I Expected
To be able to edit the Learning Mode templates.
What Happened Instead
I see the following error:

PHP / WordPress / Sensei LMS version
PHP 7.4 / WP 6.0 / Sensei LMS 4.5.1
Browser / OS version
Chrome
Context / Source
Maybe this stopped working after this change: https://github.com/WordPress/gutenberg/pull/38655 But it needs to be investigated.
It's maybe (maybe because before it was just happening in WP 5.8) duplicated to https://github.com/Automattic/sensei/issues/5083.