[wp-trac] [WordPress Trac] #55580: Featured image in Cover block missing from published page

WordPress Trac noreply at wordpress.org
Tue Apr 19 04:03:04 UTC 2022

#55580: Featured image in Cover block missing from published page
 Reporter:  ironprogrammer             |       Owner:  (none)
     Type:  defect (bug)               |      Status:  new
 Priority:  high                       |   Milestone:  6.0
Component:  Editor                     |     Version:  trunk
 Severity:  normal                     |  Resolution:
 Keywords:  has-screenshots has-patch  |     Focuses:

Comment (by costdev):

 == Test Report

 === Environment
 * Server: Apache (Linux)
 * WordPress: 6.0-beta1-53167-src
 * Browser: Chrome 100.0.4896.88
 * OS: Windows 10
 * Theme: Twenty Twenty-Two
 * Plugins: None activated

 === Steps
 1. Create a new post.
 2. In the **Settings** sidebar (opened via the "cog" icon), select the
 "Post" tab.
 3. Expand the "Featured image" section, and click "Set featured image".
 4. Select or upload an image, and click the **Set featured image** button
 when done.
 5. At the block inserter, add a new Cover block (e.g. by typing the
 `/cover` shortcut).
 6. In the block toolbar, select the "Use featured image" icon (adjacent to
 "Add Media").
 7. Observe that the featured image selected in Step 4 is displayed in the
 block. ✅
 8. Publish the post.
 9. Open the post on the frontend of the site, **and scroll past the
 template's default featured image, if present** (see note below).
 10. Observe that the Cover block background is gray, and does not display
 the featured image. ❌
 11. Apply [https://github.com/WordPress/wordpress-develop/pull/2601 PR
 12. Refresh the post on the frontend. Observe that the Cover background is
 not displaying the featured image. ✅

 === Results
 1. Without [https://github.com/WordPress/wordpress-develop/pull/2601 PR
 2601], the featured image does not appear.
 2. With [https://github.com/WordPress/wordpress-develop/pull/2601 PR
 2601], the featured image appears. ✅

 === Notes
 - Tests are failing on [https://github.com/WordPress/wordpress-
 develop/pull/2601 PR 2601] due to a `_doing_it_wrong()` being thrown when
 the `core/cover` block is already registered. I have left a comment on the
 PR with a suggested solution that causes the tests to pass while still
 showing the featured image as expected.
 - The `render_block_core_cover()` function doesn't have any tests written
 for it. These should be added and reviewed prior to commit.

Ticket URL: <https://core.trac.wordpress.org/ticket/55580#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list