Skip to content

Fix course/lesson patterns not working on latest Gutenberg - #7499

Merged
m1r0 merged 1 commit into
trunkfrom
fix/patterns-not-working-on-latest-gutenberg
Feb 22, 2024
Merged

m1r0 merged 1 commit into
trunkfrom
fix/patterns-not-working-on-latest-gutenberg

Conversation

@m1r0

@m1r0 m1r0 commented Feb 22, 2024 •

Copy link
Copy Markdown
Member

Resolves #7498

Proposed Changes

  • Replace a deprecated Gutenberg API: __experimentalGetPatternsByBlockTypes -> getPatternsByBlockTypes. The API was stabilized in 15.1.
  • Because we still support WP 6.2 and that could potentially use Gutenberg 14.2, add a fallback to the old API.

Testing Instructions

  1. Install and activate the latest version of Gutenberg (trunk or the released 17.7.0).
  2. Create a new course.
  3. Navigate to the "Course Layout" step on the wizard.
  4. The patterns should be loading.
  5. Repeat for lessons.
  6. Disable the Gutenberg plugin and test again.

Pre-Merge Checklist

  • PR title and description contain sufficient detail and accurately describe the changes
  • Acceptance criteria is met
  • Decisions are publicly documented
  • Adheres to coding standards (PHP, JavaScript, CSS, HTML)
  • All strings are translatable (without concatenation, handles plurals)
  • Follows our naming conventions (P6rkRX-4oA-p2)
  • Hooks (p6rkRX-1uS-p2) and functions are documented
  • New UIs are responsive and use a mobile-first approach
  • New UIs match the designs
  • Different user privileges (admin, teacher, subscriber) are tested as appropriate
  • Legacy courses (course without blocks) are tested
  • Code is tested on the minimum supported PHP and WordPress versions
  • User interface changes have been tested on the latest versions of Chrome, Firefox and Safari
  • "Needs Documentation" label is added if this change requires updates to documentation
  • Known issues are created as new GitHub issues

This was due to a deprecated API: `__experimentalGetPatternsByBlockTypes`
@m1r0 m1r0 added this to the 4.21.0 milestone Feb 22, 2024
@m1r0 m1r0 self-assigned this Feb 22, 2024
@m1r0
m1r0 marked this pull request as ready for review February 22, 2024 17:07
@github-actions

Copy link
Copy Markdown
Contributor

WordPress Dependencies Report

The github-action-wordpress-dependencies-report action has detected some script changes between the commit 1a9a3ee and trunk. Please review and confirm the following are correct before merging.

Script Handle Added Dependencies Removed Dependencies Total Size Size Diff
admin/editor-wizard/index.js 12.5 kB +13 B ( +0.11% 🔼 )

This comment was automatically generated by the github-action-wordpress-dependencies-report action.

@codecov

codecov Bot commented Feb 22, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (8db1ea9) 51.50% compared to head (1a9a3ee) 51.51%.
Report is 2 commits behind head on trunk.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              trunk    #7499   +/-   ##
=========================================
  Coverage     51.50%   51.51%           
  Complexity    11231    11231           
=========================================
  Files           622      622           
  Lines         47502    47503    +1     
  Branches        414      414           
=========================================
+ Hits          24468    24469    +1     
  Misses        22701    22701           
  Partials        333      333           
Files Coverage Δ
assets/admin/editor-wizard/helpers.js 66.03% <ø> (ø)
assets/admin/editor-wizard/patterns-list.js 26.66% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8ccec4d...1a9a3ee. Read the comment docs.

@m1r0
m1r0 requested a review from a team February 22, 2024 17:18

@renatho renatho left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and works well! Thank you for the quick fix!

@m1r0
m1r0 merged commit d3bb359 into trunk Feb 22, 2024
@m1r0
m1r0 deleted the fix/patterns-not-working-on-latest-gutenberg branch February 22, 2024 17:45
@donnapep

donnapep commented Feb 23, 2024 •

Copy link
Copy Markdown
Member

@m1r0 @renatho In future, let's be sure to test Gutenberg related issues on Atomic sites as well, as it wasn't fully resolved there and it's a bit unclear to me if we tested on Atomic for this PR. I may also add a task to the pre-merge checklist as a reminder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Patterns list stopped working with latest Gutenberg version on course/lesson wizard

3 participants