Skip to content

Conversation

earnjam
Copy link
Contributor

@earnjam earnjam commented Jan 3, 2019

In #9967 we addressed the issue with post dates properly floating for posts with a status of draft, but we didn't account for posts that are marked for review and thus have a status of pending. This led to #13176.

This simple fix checks for status of pending in addition to draft and auto-draft when evaluating whether a date is floating.

Fixes #13176

@@ -572,7 +572,7 @@ export function isEditedPostDateFloating( state ) {
const date = getEditedPostAttribute( state, 'date' );
const modified = getEditedPostAttribute( state, 'modified' );
const status = getEditedPostAttribute( state, 'status' );
if ( status === 'draft' || status === 'auto-draft' ) {
if ( status === 'draft' || status === 'auto-draft' || status === 'pending' ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the change makes sense! Would it be possible to add a test case covering pending state to the isEditedPostDateFloating selector test suite?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jorgefilipecosta Took care of this here #13256

Copy link
Member

@jorgefilipecosta jorgefilipecosta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that @davisshaver implemented a test case in a different PR I think this PR can be merged. PR #13256 should be merged right after.
Thank you for your PR's @earnjam and @davisshaver!

@earnjam
Copy link
Contributor Author

earnjam commented Jan 9, 2019

Thanks @davisshaver!

@earnjam earnjam merged commit 2b41810 into master Jan 10, 2019
jorgefilipecosta pushed a commit that referenced this pull request Jan 21, 2019
…13281)

This is just a follow up for #13256. It was opened against the `fix/13176-post-date-pending` branch instead of `master`. It should have been merged there first prior to #13178 getting merged. 

This just brings that test over to `master`.
youknowriad pushed a commit that referenced this pull request Mar 6, 2019
…13281)

This is just a follow up for #13256. It was opened against the `fix/13176-post-date-pending` branch instead of `master`. It should have been merged there first prior to #13178 getting merged. 

This just brings that test over to `master`.
youknowriad pushed a commit that referenced this pull request Mar 6, 2019
…13281)

This is just a follow up for #13256. It was opened against the `fix/13176-post-date-pending` branch instead of `master`. It should have been merged there first prior to #13178 getting merged. 

This just brings that test over to `master`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Saving Related to saving functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Post date should not be updated when post is set "pending review"
4 participants