Skip to content

Bulk edit: Replay the picked values against every post - #87555

Draft
oandregal wants to merge 2 commits into
trunkfrom
fix/quick-edit-bulk-status-side-effects
Draft

oandregal wants to merge 2 commits into
trunkfrom
fix/quick-edit-bulk-status-side-effects

Conversation

@oandregal

@oandregal oandregal commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

What?

Follow-up to #87547.

Bulk edit in the quick edit modal now applies each field's setValue to 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 and setValue runs against an empty item: it never sees status: '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.

  • In a bulk edit, each field passed to DataForm is wrapped so its setValue notes 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 own setValue gets DataForm's default (the value under the field id).
  • On save, each selected post is resolved (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's setValue against 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.
  • A post that can't be resolved gets the form's edits as they are, and its save reports the error.
  • Single-post quick edit is unchanged: its form already has the real post.

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.js cover 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

  1. Create two pages: one scheduled in the future, one published with a password.
  2. Go to Site Editor → Pages, switch to the Table layout, and select both pages.
  3. Click "Bulk edit", open Status, pick "Private", close the flyout and click "Done".
  4. Check that both pages are private, that the scheduled one no longer has its future date, and that the other one has no password (e.g. wp post get <id> --fields=post_status,post_date,post_password).
  5. Schedule a page again, bulk edit it with another page, pick "Draft" and then a date, and check that both pages are drafts with that date.
  6. Repeat with the extensible site editor (Gutenberg → Experiments → extensible site editor) at 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.

@oandregal oandregal added [Type] Bug An existing feature does not function as intended [Package] Edit Site /packages/edit-site [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") labels Nov 27, 2026
Copilot AI balanced review requested due to automatic review settings November 27, 2026 11:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground Preview in Storybook

🎉 Props

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: oandregal <oandregal@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

📦 Bundle size

Size Change: +257 B (0%)

Total Size: 8.73 MB

📦 View Changed
Filename Size Change
build/scripts/edit-site/index.min.js 384 kB +257 B (+0.07%)

ea91bdf Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric a37a073 trunk % Change
timeToFirstByte 56.95 ms +4.83% -2.99% 57.8 ms +4.33% -4.24% -1.47%
largestContentfulPaint 94 ms +2.13% -10.64% 88 ms +2.27% -4.55% 6.82%
lcpMinusTtfb 33.45 ms +16.44% -14.05% 28.35 ms +12.17% -4.41% 17.99%
wpBeforeTemplate 29.85 ms +13.67% -1.31% 30.16 ms +6.2% -2.65% -1.03%
wpTemplate 22.74 ms +3.69% -2.99% 22.82 ms +3.07% -3.02% -0.35%
wpTotal 52.89 ms +5.71% -2.31% 53.98 ms +4.72% -4.04% -2.02%
wpMemoryUsage 7.75 MB +0% -0% 7.72 MB +0% -0% 0.45%
wpDbQueries 16 +0% -0% 16 +0% -0% 0%

front-end-classic-theme

Metric a37a073 trunk % Change
timeToFirstByte 47.6 ms +8.09% -3.15% 48.05 ms +3.02% -2.71% -0.94%
largestContentfulPaint 84 ms +4.76% -4.76% 84 ms +2.38% -4.76% 0%
lcpMinusTtfb 35.5 ms +3.1% -4.23% 34.55 ms +3.47% -3.91% 2.75%
wpBeforeTemplate 27.48 ms +8.92% -1.31% 27.49 ms +2.55% -1.71% -0.04%
wpTemplate 16.52 ms +3.69% -3.63% 16.52 ms +3.21% -3.15% 0%
wpTotal 44.46 ms +7.42% -2.83% 44.56 ms +4.47% -2.22% -0.22%
wpMemoryUsage 6.44 MB +0% -0% 6.41 MB +0% -0% 0.56%
wpDbQueries 13 +0% -0% 13 +0% -0% 0%

media-processing

Metric a37a073 trunk % Change
mediaProcessingJpeg 399.66 ms +1.4% -1.74% 400.81 ms +0.85% -0.8% -0.29%
mediaProcessingAvif 6148.2 ms +0.15% -0.22% 6148.48 ms +0.24% -0.36% 0%
mediaProcessingJpegToAvif 4226.77 ms +0.23% -0.23% 4233.86 ms +0.13% -0.39% -0.17%

media-upload

Metric a37a073 trunk % Change
jpegUploadProcessing 1525.35 ms +34.26% -2.68% 1515.4 ms +29.01% -1.67% 0.66%
pngUploadProcessing 265.57 ms +2.04% -4.25% 275.19 ms +2.16% -4.4% -3.5%
largeJpegUploadProcessing 1749.91 ms +14.3% -14.65% 1735.19 ms +14.22% -13.79% 0.85%
multipleImageUploadProcessing 2062.02 ms +0.77% -18.52% 2098.48 ms +0.75% -6.44% -1.74%

post-editor

Metric a37a073 trunk % Change
serverResponse 321.45 ms +2.51% -10.09% 337.26 ms +1.51% -9.68% -4.69%
firstPaint 359.92 ms +1.82% -5.09% 363.3 ms +7.7% -8.33% -0.93%
domContentLoaded 649.49 ms +0.8% -1.49% 689.42 ms +1.04% -1.58% -5.79%
loaded 650.32 ms +0.8% -1.5% 690.43 ms +1.04% -1.54% -5.81%
firstContentfulPaint 369.54 ms +1.06% -2.39% 388.62 ms +3.68% -1.4% -4.91%
firstBlock 1741.62 ms +1.04% -0.88% 1854.65 ms +0.95% -0.59% -6.09%
type 15.55 ms +4.05% -11% 16.8 ms +3.87% -11.43% -7.44%
typeWithoutInspector 15.06 ms +13.48% -4.98% 15.67 ms +10.15% -5.49% -3.89%
typeWithTopToolbar 20.34 ms +2.11% -3.83% 19.95 ms +9.72% -1.5% 1.95%
typeContainer 7.53 ms +9.96% -7.3% 7.21 ms +5.13% -13.31% 4.44%
focus 97.14 ms +6.93% -5.51% 86.37 ms +6.67% -2.35% 12.47%
firstFocus 215.12 ms +0% -0% 204.06 ms +0% -0% 5.42%
selectAll 329.35 ms +6.23% -0.61% 311.65 ms +0.76% -1.91% 5.68%
undo 26.14 ms +8.8% -3.79% 25.65 ms +6.94% -4.91% 1.91%
listViewOpen 34.75 ms +2.62% -4.78% 32.63 ms +4.32% -7.39% 6.5%
inserterOpen 36.57 ms +7.19% -12.69% 33.52 ms +3.1% -8.17% 9.1%
inserterHover 10.26 ms +3.02% -6.53% 10.38 ms +12.14% -9.15% -1.16%
inserterSearch 7.76 ms +1.93% -5.41% 7.5 ms +5.2% -5.2% 3.47%
loadPatterns 544.01 ms +4.97% -6.13% 521.34 ms +2.29% -4.08% 4.35%
wpTotal 312.87 ms +2.57% -10.37% 328.38 ms +1.55% -9.9% -4.72%
wpMemoryUsage 14.81 MB +0% -0% 14.76 MB +0% -0% 0.33%
wpDbQueries 55 +0% -0% 55 +0% -0% 0%

site-editor

Metric a37a073 trunk % Change
serverResponse 395.08 ms +3.29% -4.76% 381.53 ms +5.78% -1.86% 3.55%
firstPaint 442.69 ms +4.17% -7.63% 413.79 ms +9.46% -11.11% 6.98%
domContentLoaded 816.99 ms +1.85% -0.71% 812.89 ms +0.53% -1.04% 0.5%
loaded 817.95 ms +1.83% -0.69% 813.95 ms +0.51% -1.04% 0.49%
firstContentfulPaint 453.98 ms +1.72% -1.59% 451.5 ms +1.6% -2.56% 0.55%
firstBlock 2437.41 ms +5.61% -1.01% 2420.42 ms +1.76% -0.35% 0.7%
type 17.03 ms +6.58% -7.28% 17.12 ms +4.96% -9.46% -0.53%
navigate 115.76 ms +1.49% -3.28% 114.97 ms +1.5% -2.42% 0.69%
loadPatterns 1338.4 ms +7.48% -14.23% 1328.15 ms +6.99% -4.33% 0.77%
loadPages 930.55 ms +3.12% -2.18% 932.89 ms +1.61% -1.63% -0.25%
wpTotal 385.95 ms +3.37% -4.86% 372.18 ms +6.01% -1.82% 3.7%
wpMemoryUsage 12.84 MB +0% -0% 12.80 MB +0% -0% 0.28%
wpDbQueries 45 +0% -0% 45 +0% -0% 0%

ea91bdf Run

🏁 Flaky tests

Some 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 /test/e2e/specs/editor/blocks/tabs.spec.js, passed after 1 failed attempt.
Error: expect(received).toBe(expected) // Object.is equality

Expected: 0
Received: 1

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/tabs.spec.js:736:60

ea91bdf Run

oandregal and others added 2 commits November 27, 2026 12:54
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>
@oandregal
oandregal force-pushed the fix/quick-edit-bulk-status-side-effects branch from 823baaf to ea91bdf Compare November 27, 2026 11:59
@oandregal oandregal changed the title Quick edit: Apply the status side effects to every post of a bulk edit Quick edit: Replay the picked values against every post of a bulk edit Nov 27, 2026
@oandregal oandregal changed the title Quick edit: Replay the picked values against every post of a bulk edit Bulk edit: Replay the picked values against every post Nov 27, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Package] Edit Site /packages/edit-site [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants