-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix broken Learning Mode templates on Gutenberg 17.1.0 #7317
Conversation
WordPress Dependencies ReportThe
This comment was automatically generated by the |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## trunk #7317 +/- ##
=========================================
Coverage 50.81% 50.81%
Complexity 11060 11060
=========================================
Files 611 611
Lines 46727 46727
Branches 404 404
=========================================
Hits 23744 23744
Misses 22656 22656
Partials 327 327 Continue to review full report in Codecov by Sentry.
|
Nice catch! I thought the blocks would show up under the Sensei LMS category, not theme. 🤨 I made a change in 11c2bef to return early if we're in the site editor. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! It works for me now, and the blocks are only available on the template editor.
Proposed Changes
Comments out code that was erroneously unregistering Sensei's blocks for the Learning Mode templates (see screenshot below).UPDATE: Return early if the post type iswp_template
(prior to Gutenberg 17.1.0 the call togetCurrentPostType
would returnnull
).The original intention of this code appears to have been to only make Sensei's blocks available for the Learning Mode templates. However, this code wasn't working regardless because the call to
getCurrentPostType
always returnednull
, which meant the call to unregister the blocks never actually fired because it returned early.This is a quick fix to get things back to working how they were before, but we will need to create a separate issue to properly unregister Sensei blocks for non-Learning Mode templates (which likely hasn't worked for quite some time, if ever).
Before
Testing Instructions
Pre-Merge Checklist