Repository navigation
Conversation
🤖 PR meta 🤖🎉 PropsIf 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. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: +257 B (0%) Total Size: 8.73 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. keeps the default tab on the moved tab in
|
A bulk edit shows no post, so each field's `setValue` ran against the form's own edits, and the modal saved the same edits to every post. A field whose `setValue` depends on the post couldn't apply what its value means for each one: the status field never cleared the future date of a scheduled post moved to another status, or the password of a post made private. In a bulk edit, the quick edit modals of the site editor (v1) and the extensible site editor (v2) now note the value each field picks, and on save replay those values, in the order they were last picked, through their field's `setValue` against each post. The modals don't know about any particular field: the side effects stay in the status field. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cover the date a scheduled page drops when it becomes a draft, the password a page drops when it becomes private, both at once in a bulk edit, and a date picked after the status in a bulk edit, which replaces the dropped one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
823baaf to
ea91bdf
Compare
What?
Follow-up to #87547.
Bulk edit in the quick edit modal now applies each field's
setValueto every selected post, so a field whose edits depend on the post works in bulk too. With the status field, that means a scheduled post moved to another status drops its date in the future, and a post made private drops its password.Why?
Since #87547, the status side effects live only in the status field's
setValue. A bulk edit shows no post, so the form's data is just the local edits andsetValueruns against an empty item: it never seesstatus: 'future'or a password, and clears nothing. The modal then saved those same edits to every post. Moving several scheduled pages to Draft kept their future dates, and making password-protected pages Private kept their passwords. The modals had the same gap before #87547, as their own copy of the rules read the same empty record.How?
The modals don't know about any particular field; the rules stay in the status field.
DataFormis wrapped so itssetValuenotes the value picked (withPickedValue). Picking a field again moves it last, so the picks keep the order they were last made in. A field without its ownsetValuegets DataForm's default (the value under the field id).resolveSelect( coreDataStore ).getEditedEntityRecord, which fetches the full record if the list only loaded part of it), and the picked values are replayed through their field'ssetValueagainst it, each one against the post as the earlier picks leave it (replayPickedValues). Each post gets the edits it would get if it had been edited alone.The change is made in both quick edit modals: the site editor (
packages/edit-site) and the extensible site editor (routes/post-list).New e2e tests in
page-list.spec.jscover a scheduled page becoming a draft, a password-protected page becoming private, both at once in a bulk edit, and a date picked after the status in a bulk edit (it replaces the dropped date). They pass in both the classic and the extensible site editor configs.Testing Instructions
wp post get <id> --fields=post_status,post_date,post_password).wp-admin/admin.php?page=site-editor-v2&p=%2Ftypes%2Fpage%2Flist%2Fall.Testing Instructions for Keyboard
No UI change.
Use of AI Tools
Written with Claude Code (Claude Opus 5.5), which found the gap while reviewing #87547, wrote the fix and the e2e tests, and ran them against a local environment.