Repository navigation
Repair wp/5.7 branch Actions: Handle a missing widget name when saving a widget in the widgets REST controller - #84794
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Size Change: 0 B Total Size: 1.37 MB ℹ️ View Unchanged
|
99df504 to
e90e9b3
Compare
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
e90e9b3 to
318787c
Compare
318787c to
2c86332
Compare
ntsekouras
left a comment
There was a problem hiding this comment.
LGTM, thanks! The three widget tests no longer fail on PHP 8.0, and the remaining Template controller error is fixed in the next PR.
2c86332 to
b52ae08
Compare
Part of #82936.
What?
In
WP_REST_Widgets_Controller::save_widget(), passesnullas the widget name when the request has noname, instead of reading$input_widget['name']unconditionally.Why?
The request doesn't have to include
name. On PHP 8 the missing key is a warning, so threeREST_Widgets_Controller_Testtests fail on thePHP 8.0jobs:These endpoints first shipped in WordPress 5.8. On this branch they exist only as plugin code in
lib/, which isn't in any npm package and never reaches a WordPress 5.7 release. A small change here keeps the tests green, so security fixes for the packages WordPress 5.7 does ship can be verified reliably.How?
The
isset()ternary passes the samenullPHP 7 already passed, so behavior is unchanged. It's used instead of??because this file also loads on PHP 5.6. Later versions of this controller were rewritten, so there's no upstream fix to port.Use of AI Tools
This PR was created by Claude Code under my supervision. All code should be treated as AI-produced and not yet reviewed by a human until this PR is marked Ready for Review.
🤖 Generated with Claude Code