Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#54623 closed defect (bug) (fixed)

Block Patterns: "Featured" category & patterns missing from inserter

Reported by: ryelle's profile ryelle Owned by: hellofromtonya's profile hellofromTonya
Milestone: 5.9 Priority: normal
Severity: normal Version:
Component: Editor Keywords: has-patch has-testing-info commit
Focuses: Cc:

Description

In Gutenberg 11.8, the block patterns were updated to also show a "Featured" category, which loads the featured patterns from the Pattern Directory. See the original gutenberg PR here.

It seems like this was not ported back to core, so the behavior in Gutenberg & core is different.

Attachments (3)

54623.diff (2.6 KB) - added by ryelle 3 years ago.
Screen Shot 2021-12-14 at 11.19.27 AM.png (788.9 KB) - added by ryelle 3 years ago.
test-before-after-patch-applied.gif (7.6 MB) - added by hellofromTonya 3 years ago.
Test Report: Can reproduce ("Before"). Applying the patch ("After"), featured patterns now appear at the end. Works ✅

Change History (8)

@ryelle
3 years ago

This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.


3 years ago

@hellofromTonya
3 years ago

Test Report: Can reproduce ("Before"). Applying the patch ("After"), featured patterns now appear at the end. Works ✅

#2 @hellofromTonya
3 years ago

  • Keywords has-testing-info added
  • Owner set to hellofromTonya
  • Status changed from new to reviewing

Test Report

Env:

  • OS: macOS Big Sur
  • Plugins: none activated
  • Theme: TT2
  • WordPress: trunk
  • Localhost: wp-env
  • Browser: Chrome and Edge

Steps

  1. Navigate to Pages
  2. Add a new page
  3. Click on the + icon to toggle the block inserter open
  4. Click on the "Patterns" tab
  5. Either scroll the featured in the left sidebar or click on the "Explore" button to open the Patterns modal.

Expected behavior: Featured patterns should be included.

Results

  • Able to reproduce reported issue
  • Applying the 54623.diff patch resolves the issue ✅

#3 @hellofromTonya
3 years ago

  • Keywords commit added

Marking for commit. Self-assigned to prepare commit.

Note: The hardcoded 26 is the featured category ID from the remote pattern directory, not a cat in Core. Took me a minute to realize why this hardcoded number is used.

#4 @ryelle
3 years ago

Note: The hardcoded 26 is the featured category ID from the remote pattern directory, not a cat in Core. Took me a minute to realize why this hardcoded number is used.

Yeah, that mirrors the behavior in the _load_remote_block_patterns where a similar hardcoded value is set (the core keyword). Hopefully in 6.0 we'll be able to phase that out in favor of loading all the patterns from w.org/patterns :)

Thanks for taking care of the commit!

#5 @hellofromTonya
3 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 52377:

Editor: Add "Featured" patterns from pattern directory to Patterns in block inserter.

This commit backports the remote "Featured" category request and loads it into the Featured Patterns in the block inserter.

Props ryelle.
Fixes #54623.

Note: See TracTickets for help on using tickets.