-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refresh sidebars widgets global after calling wp_set_sidebars_widgets #1525
base: trunk
Are you sure you want to change the base?
Refresh sidebars widgets global after calling wp_set_sidebars_widgets #1525
Conversation
@draganescu feedback addressed, would you mind re-reviewing please? |
This looks good now IMO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few coding standard fixes needed. Then I'll do a testing with both the block and classic widgets.
@hellofromtonya I committed your suggestions – thank you! There were also some conflicts that I resolved. This should be good to go! |
Test ReportEnv:
Testing InstructionsStep 1: Set up the environment:
Step 2: Interact with widgets and observe: add new ones, reorder, and move some to Inactive. Expectation:
Step 3: Interact with widgets in Customizer Expectations:
Step 4: Apply this PR and rebuild
Step 5: Repeat Step 2 and 3 above Expectations: same expectations as above ResultsAll tests worked as expected ✅ No change when applying the patch ✅ |
Related: #1578 |
@hellofromtonya @desrosj I believe all the feedback on this one is now addressed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking that since #53811 has been punted to the 5.9 release, the same should be done for this one. Especially since the sync_registered_widgets()
function is being discussed further in Core-53811 and this PR assumes that the function is present in Core.
I also noted inline that I'm apprehensive to make a change to a function's signature in a minor release unless it cannot be avoided.
a7d1566
to
f672c0e
Compare
Thanks for surfacing this PR @draganescu! I just applied all the required changes.
@desrosj I reverted to the old,
Snap, we've missed the 6.0 train with this one. Would you be willing to reconsider including this patch in 6.0.1, or do you want to wait to 6.1? |
The single failing test is unrelated to this PR:
|
As this is an enhancement and part of a refactoring, it could not go into a minor, but is a candidate for a major such as 6.1. Minors are for bug fixes and security. |
@hellofromtonya does it need to be added to any list, or do we leave it here and it will get discovered when the time comes? |
Great question @adamziel (and Hello 👋 ). The Trac ticket is already in the 6.1 milestone. And you've refreshed this PR and discussion. As it's in the milestone, it'll also be part of the 6.1 scrub/triage process once the release squad is formed. Is the updated PR ready for feedback and test report(s)? If yes, some tips: (a) remove the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! This review makes some minor suggestions for consistency with Core docblocks and with the test suite.
Co-authored-by: Colin Stewart <[email protected]>
Co-authored-by: Colin Stewart <[email protected]>
Thank you @costdev ! I just applied the changes you suggested |
…ebars_widgets' of github.com:adamziel/wordpress-develop into update/refresh_sidebars_widgets_global_after_wp_set_sidebars_widgets
@adamziel Thanks! There's also the
|
Needed some realignment for the params after changing boolean to bool. Removed the . after $sidebars_widgets as this sentence continues with the word "global.". Co-authored-by: Colin Stewart <[email protected]>
…ebars_widgets' of github.com:adamziel/wordpress-develop into update/refresh_sidebars_widgets_global_after_wp_set_sidebars_widgets
@costdev Ah good note! I just added these messages and committed your suggestion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR looks great to me. I'll try to get this tested again and leave a report on the ticket. 🙂
Thanks @adamziel, Left nit-pick feedback. |
Co-authored-by: Mukesh Panchal <[email protected]>
Thanks @mukeshpanchal27! |
Description
Before this PR, batch-saving widgets sometimes moves one of them to "Inactive widgets". The full, step-by-step problem description can be found here.
Tactically, this PR removes the
retrieve_widget
call that was placed in the API endpoints as a workaround for the following problem:The solution introduced in this PR is correctly refreshing the related global variable in
wp_set_sidebar_widgets
.Test plan
Trac ticket: https://core.trac.wordpress.org/ticket/53816
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.