Skip to content

fix(ui): use server response when resetting form after unpublish#17050

Open
shaklan2001 wants to merge 1 commit into
payloadcms:mainfrom
shaklan2001:fix/issue-16755-unpublish-form-reset
Open

fix(ui): use server response when resetting form after unpublish#17050
shaklan2001 wants to merge 1 commit into
payloadcms:mainfrom
shaklan2001:fix/issue-16755-unpublish-form-reset

Conversation

@shaklan2001

Copy link
Copy Markdown

Summary

  • After unpublish, reset the admin form from the API response instead of stale dataFromProps
  • Ensures beforeChange hook modifications (e.g. clearing publishedAt) are reflected immediately in the UI
  • Adds e2e coverage with a collection whose beforeChange hook clears note on unpublish

Related issue

Fixes #16755

Test plan

  • Manual repro on pnpm dev versions — unpublish clears note without page reload
  • pnpm run test:e2e versions -- --grep "should reset form with server data after unpublish"

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UnpublishButton does not reflect beforeChange hook modifications in form state

1 participant