Make WordPress Core

Opened 6 years ago

Last modified 2 years ago

#44511 new defect (bug)

Widgets generated by wp_register_sidebar_widget can not be add via customizer

Reported by: bastho's profile bastho Owned by:
Milestone: Future Release Priority: normal
Severity: major Version: 4.9.6
Component: Customize Keywords: needs-testing reporter-feedback
Focuses: Cc:

Description

Single use widgets, generated by wp_register_sidebar_widget and managed by wp_register_widget_control always return an "Invalid value" error in Customizer. They also block saving in Customizer.

We still can add them via appearance/widgets.php and go back to customizer.

Example to reproduce:

<?php
add_action('widgets_init', 'proof_of_concept_register_widget');
function proof_of_concept_register_widget(){
    wp_register_sidebar_widget(
        'poc_widget',
        'POC Widget',
        'poc_widget_display',
        array(
        'description' => 'POC for Customize bug'
        )
    );
    wp_register_widget_control('poc_widget', 'poc_widget', 'poc_widget_control');
}
function poc_widget_display(){
    echo '<p>POC for Customize bug</p>';
}
function poc_widget_control(){
    echo '<p>You should see a red notice "Invalid value" just above</p>';
}


Change History (7)

#1 @celloexpressions
3 years ago

  • Keywords needs-testing added
  • Milestone changed from Awaiting Review to 5.8

There is some logic in the old customize widgets class to address "single" (as opposed to "multi") widgets. However, it sounds like that may have broken at some point.

Now that widgets are replaced with blocks in 5.8, we need to confirm that "single" widgets "still" work. If they do, then this can likely be closed as fixed in 5.8. If they don't but we can confirm they were broken on 5.7 also, then this can maybe move to Future Release.

Given that the block inserter replaces the add-widgets panel in the customizer, this would probably need to be fixed with 5.8 as the widgets screen would also be broken now. Another option would be to formally deprecate "single" widgets.

#2 @hellofromTonya
3 years ago

  • Milestone changed from 5.8 to 5.9

Today is 5.8 Beta 1. Investigation is ongoing. Punting to 5.9.

#3 @hellofromTonya
2 years ago

  • Milestone changed from 5.9 to 6.0

5.9 Beta 1 is in < 19 hours. With no movement on this ticket, moving to 6.0 for further investigation.

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


2 years ago

#5 @costdev
2 years ago

  • Keywords reporter-feedback added

Per the discussion in the bug scrub, I'm adding reporter-feedback to see if this is still an issue after the transition to Block Widgets.

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


2 years ago

#7 @costdev
2 years ago

  • Milestone changed from 6.0 to Future Release

This ticket was discussed in the bug scrub. As there has been no progress in quite some time, I'm moving this ticket to Future Release.

Note: See TracTickets for help on using tickets.