Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#55072 closed defect (bug) (fixed)

Widgets editor: Widget Group is missing .wp-widget-group__inner-blocks container

Reported by: noisysocks's profile noisysocks Owned by: audrasjb's profile audrasjb
Milestone: 5.9.1 Priority: normal
Severity: normal Version: 5.9
Component: Widgets Keywords: has-patch has-testing-info commit needs-dev-note fixed-major
Focuses: Cc:

Description

Some markup is missing from the Widget Group block when viewed on the frontend.

Steps to reproduce:

  1. Activate a classic theme.
  2. Go to Appearance → Widgets.
  3. Insert a Widget Group block.
  4. Add some content into the group and set a title.
  5. Save.
  6. View the website frontend.

There should be a <div class="wp-widget-group__inner-blocks"> container in the rendered widget, but there isn't.

The container exists when running the Gutenberg plugin, so this is most definitely due to a missing backport.

Change History (12)

This ticket was mentioned in PR #2269 on WordPress/wordpress-develop by noisysocks.


2 years ago
#1

  • Keywords has-patch added

The Widget Group block was missing a <div class="wp-widget-group__inner-blocks"> container when rendered on the frontend. This is because the block's PHP file was not included and so the block was defaulting to what is returned by the block's save() function.

To test:

  1. Activate a classic theme.
  2. Go to Appearance → Widgets.
  3. Insert a Widget Group block.
  4. Add some content into the group and set a title.
  5. Save.
  6. View the website frontend.
  7. You should see <div class="wp-widget-group__inner-blocks"> in the markup.

Trac ticket: https://core.trac.wordpress.org/ticket/55072

#2 @Boniu91
2 years ago

  • Keywords needs-testing has-testing-info added

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


2 years ago

#4 @ironprogrammer
2 years ago

UPDATED: The heading level change appears to be theme dependent. The test below was with Twenty Eleven. This is not an issue with themes since Twenty Fifteen.

---

I can reproduce this issue.

Also note that the title's heading level changes from H2 to H3 when Gutenberg is enabled. @noisysocks did you see this as well?

Widget Group block with Gutenberg DISABLED 🔴:

<aside id="block-7" class="widget widget_block">
    <h2 class="widget-title">Test title</h2>
    <p>Test content</p>
</aside>

Widget Group block with Gutenberg ENABLED 🟢:

<aside id="block-7" class="widget widget_block">
    <h3 class="widget-title">Test title</h3>
    <div class="wp-widget-group__inner-blocks">
        <p>Test content</p>
    </div>
</aside>
Last edited 2 years ago by ironprogrammer (previous) (diff)

#5 @ironprogrammer
2 years ago

  • Keywords needs-testing removed

PR 2269 works as expected.

Test Report

Env

  • WordPress 6.0-alpha-20220211.100311
  • Safari 15.3
  • macOS 12.2.1 (Monterey)
  • Theme: Twenty Twenty
  • Gutenberg plugin DISABLED 🔴 (if enabled, it will create a false positive test for the patch)

Steps to Test

  1. Activate a non-block theme.
  2. In Appearance > Widgets, add a Widget Group Block.
  3. Insert a Paragraph block with paragraph copy and set a title.
  4. Save/Update Widgets.
  5. Open site front end and View Source or open a DOM inspector.
  6. Within div.widget-content is .wp-widget-group__inner-blocks, containing the paragraph. ✅
  7. Note: The .widget-title is not nested within .wp-widget-group__inner-blocks.

DOM screenshot:
https://cldup.com/L57dDa_Wvd.png

#6 @noisysocks
2 years ago

  • Keywords commit added

Thanks for testing @ironprogrammer!

#7 @peterwilsoncc
2 years ago

  • Keywords needs-dev-note added

This will need a brief dev-note as it's a back-compat break between 5.9 and 5.9.1

#8 @audrasjb
2 years ago

  • Owner changed from noisysocks to audrasjb

Thanks for testing. Let's get this fixed in 5.9.1.
Self assigning for commit.

We'll need to publish a note at least in the 5.9.1 RC post.

#9 @audrasjb
2 years ago

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

In 52730:

Widgets: Missing markup from Widgets Group block.

This change fixes an issue in the Widgets editor: widgets group was missing a .wp-widget-group__inner-blocks container.

Props noisysocks, ironprogrammer.
Fixes #55072.

#10 @audrasjb
2 years ago

  • Keywords fixed-major added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for backport.

#12 @audrasjb
2 years ago

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

In 52731:

Widgets: Missing markup from Widgets Group block.

This change fixes an issue in the Widgets editor: widgets group was missing a .wp-widget-group__inner-blocks container.

Props noisysocks, ironprogrammer.
Merges [52730] to the 5.9 branch.
Fixes #55072.

Note: See TracTickets for help on using tickets.