WordPress.org

Make WordPress Core

Opened 10 days ago

Last modified 38 hours ago

#53332 new defect (bug)

Transforming a Legacy Widget to a Block Widget is not possible in WP 5.8

Reported by: imath Owned by:
Milestone: 5.8 Priority: normal
Severity: normal Version:
Component: Widgets Keywords: has-patch
Focuses: Cc:

Description

Hi,

I'm currently working on migrating BuddyPress legacy widgets to BuddyPress Blocks to anticipate the introduction of the Widgets Block Editor into WordPress 5.8.

This documentation page is explaining the steps to allow migrating a Legacy Widget to a Block one. I've applied it and it's working fine using the Gutenberg plugin (10.7.1) in WP 5.7.2 as shows the following screen capture :

https://cldup.com/9Ki9SucsM4.png

But as soon as I switch to WordPress trunk (5.8) (having the Gutenberg plugin deactivated), the list of transformations doesn't include anymore the BP Block. Here's a screen capture of the result in 5.8:

https://cldup.com/-8wku15-ws.png

Attachments (1)

53332.patch (1.9 KB) - added by imath 38 hours ago.

Download all attachments as: .zip

Change History (4)

#1 @noisysocks
4 days ago

  • Milestone changed from Awaiting Review to 5.8

This ticket was mentioned in Slack in #core-test by johnbillion. View the logs.


3 days ago

@imath
38 hours ago

#3 @imath
38 hours ago

  • Keywords has-patch added

I've found the reason why. While the documentation page and the Gutenberg plugin are using the Widget's class $show_instance_in_rest property. WordPress decided to stop checking this property into the Widgets REST endpoints in favor of looking into the $widget_options['show_instance_in_rest'] property.

53332.patch is fixing my issue. The patch is a kind of back compatibility mechanism for early testers who got used to the $show_instance_in_rest property.

If you think it's not needed, I'd advise to at least update this documentation page (to avoid misleading developers) to explain people now need to include a $widget_options['show_instance_in_rest'] = true when registering their widget.

Note: See TracTickets for help on using tickets.