[8.2-stable] fix(Publishable): Use Time.current in publishable?#3867
Open
tvdeyen wants to merge 2 commits into8.2-stablefrom
Open
[8.2-stable] fix(Publishable): Use Time.current in publishable?#3867tvdeyen wants to merge 2 commits into8.2-stablefrom
tvdeyen wants to merge 2 commits into8.2-stablefrom
Conversation
The Publishable concern provides the same instance methods, but with a slightly different signature. Since these methods are identical and only used internally we can remove them.
The publishable? predicate was delegating to still_public_for? without passing an explicit time, so it defaulted to Current.preview_time. When an editor selected a future preview time and then hit Publish, any element whose public_until was in the future relative to now but before the previewed moment was treated as already expired and was silently excluded from the public version of the page.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 8.2-stable #3867 +/- ##
===========================================
Coverage 98.06% 98.07%
===========================================
Files 322 322
Lines 8547 8558 +11
===========================================
+ Hits 8382 8393 +11
Misses 165 165 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this pull request for?
Backport of #3866 to
8.2-stable.Publishable#publishable?was delegating tostill_public_for?without an explicitat:argument, so the check defaulted toCurrent.preview_time. When an editor selected a future preview time and then hit Publish, any element whosepublic_untilwas in the future relative to now but before the previewed moment was treated as already expired and was silently excluded from the public version of the page.To keep the fix minimal and consistent with the keyword-argument signature on the
Publishableconcern, the redundantstill_public_for?/already_public_for?/public?overrides onPageVersionare removed first (cherry-picked from c402e58 onmain).Checklist