Skip to content

fix(ui): update status to published after locale-specific publish#15765

Open
maximseshuk wants to merge 1 commit intopayloadcms:mainfrom
maximseshuk:fix/publish-specific-locale-status
Open

fix(ui): update status to published after locale-specific publish#15765
maximseshuk wants to merge 1 commit intopayloadcms:mainfrom
maximseshuk:fix/publish-specific-locale-status

Conversation

@maximseshuk
Copy link
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.
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.

1 participant