Content: Ensure correct variant change tracking when unpublishing variant content - #22799
Conversation
|
Claude finished @kjac's task in 4m 25s —— View job PR ReviewTarget: Fixes two related bugs in variant publish-status tracking: after all cultures are individually unpublished the in-memory status cache retained a stale entry (causing
Suggestions
Approved with Suggestions for improvementGood to go — the bug fixes are correct, well-targeted, and backed by a well-structured integration test covering both unpublish paths. Please carefully consider the importance of the suggestions. |
AndyButland
left a comment
There was a problem hiding this comment.
This looks good and tests out as expected @kjac. I've checked the before and after on v17/dev and this branch and see the issue and resolution.
Left a couple of nit-pick comments but then all good to merge.
Will leave you to label and cherry-pick once that done, but seems to me this should be:
- Cherry-picked to
release/17.5.0and labelled withrelease/17.5.0. v17/devmerged tomain.- Cherry-picked to
release/18.0and labelled withrelease/18.0.0.
Co-authored-by: Andy Butland <abutland73@gmail.com>
…iant content (#22799) * Ensure correct change tracking when unpublishing * Update src/Umbraco.Core/Services/PublishStatus/PublishStatusService.cs Co-authored-by: Andy Butland <abutland73@gmail.com> * Add comment --------- Co-authored-by: Andy Butland <abutland73@gmail.com>
|
Cherry-picked to 17.5 in fc9ca86 |
|
Cherry-picked to |
|
Cherry-picked to 18.0 in 3daf727 |
Prerequisites
Description
This PR addresses a couple of issues with our tracking of published status for variants, specifically tied to unpublishing variant content:
Invariant remains published after unpublishing cultures in turn
After unpublishing all cultures one at a time, the
IPublishStatusQueryServicestill reports the now fully unpublished content as being published in the invariant culture.Publish state tracking fails when unpublishing all cultures
When "bulk" unpublishing all cultures in a single operation (
IContentService.Unpublish()with no culture specified),IPublishStatusQueryServicecontinues to report all culture variants of the content as published.Testing this PR
The first issue can be reproduced using the backoffice, because this is exclusively how the backoffice works - it only ever unpublishes specific cultures (likely this is also why this issue has remained undiscovered).
The second requires a bit of custom code to perform the unpublishing. I have used this controller:
Now, given this content structure, where all pages are published in
en-USandda-DK:...and given this template:
...this is the initial rendering:
When unpublishing all cultures of "Child 1" from the backoffice, the output still claims that "Child 1" is published for the invariant culture:
When unpublishing "Child 2" using the custom controller, the output continues to claim that "Child 2" is fully published:
...when in fact it is not - which the backoffice correctly displays: