Skip to content

fix(ui): document status shows changed after publishing specific locale#15765

Merged
PatrikKozak merged 1 commit intopayloadcms:mainfrom
maximseshuk:fix/publish-specific-locale-status
Mar 10, 2026
Merged

fix(ui): document status shows changed after publishing specific locale#15765
PatrikKozak merged 1 commit intopayloadcms:mainfrom
maximseshuk:fix/publish-specific-locale-status

Conversation

@maximseshuk
Copy link
Copy Markdown
Contributor

What?

When localizeStatus is enabled and defaultLocalePublishOption is set to active, publishing a specific locale leaves the document status showing "Changed" instead of "Published" until the page is refreshed.

Why?

The publishSpecificLocale callback in PublishButton only called setHasPublishedDoc(true) on success, but did not reset unpublishedVersionCount or mostRecentVersionIsAutosaved. The Status component uses unpublishedVersionCount > 0 && hasPublishedDoc to render "Changed", so the stale count kept the status incorrect.

The publish (all locales) callback already handled this correctly, publishSpecificLocale was just missing the same state resets.

How?

Added setUnpublishedVersionCount(0) and setMostRecentVersionIsAutosaved(false) to the publishSpecificLocale success handler, matching what publish already does. Added an e2e test that reproduces the issue.

publishSpecificLocale callback was not resetting unpublishedVersionCount
and mostRecentVersionIsAutosaved, causing the Status component to show
"Changed" instead of "Published" after a locale-specific publish.
@PatrikKozak
Copy link
Copy Markdown
Contributor

@maximseshuk Fix looks good and thank you for adding the test as well! Going to merge!

Thank you for the contribution!

@PatrikKozak PatrikKozak changed the title fix(ui): update status to published after locale-specific publish fix(ui): document status shows changed after publishing specific locale Mar 10, 2026
@PatrikKozak PatrikKozak merged commit b95df0b into payloadcms:main Mar 10, 2026
157 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

🚀 This is included in version v3.79.1

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants