Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Private post with future date becomes public on update #18834

Conversation

@jorgefilipecosta
Copy link
Member

jorgefilipecosta commented Nov 29, 2019

Description

Fixes: #13374

Currently, If we create a post set a future date and change the visibility to private, the post saves as private with a future publish date. When reloading, the information is right. After the reload, if we change something in the post and then press update, the post becomes public right away.

The problem is the order of the post status evaluation rules; we first see if the date is in the future, and if yes, we set a future status. We should first verify if the post is private and if yes, we should keep the status.

How has this been tested?

I verified the bug I described above is fixed.
I verified #13374 is fixed (requires classic editor plugin to test).

Copy link
Contributor

youknowriad left a comment

Should we add an e2e test about this?

@jorgefilipecosta jorgefilipecosta force-pushed the fix/private-post-with-future-date-becomes-public-on-save branch from d1a5992 to e821f70 Dec 2, 2019
@jorgefilipecosta

This comment has been minimized.

Copy link
Member Author

jorgefilipecosta commented Dec 2, 2019

Hi @youknowriad, an end 2 end test was added. Reverting the fix file changes and running the end to end tests we can see they fail.

Copy link
Contributor

youknowriad left a comment

LGTM 👍

@youknowriad

This comment has been minimized.

Copy link
Contributor

youknowriad commented Dec 2, 2019

Thanks for the test

@jorgefilipecosta jorgefilipecosta merged commit 5671c0a into master Dec 2, 2019
2 checks passed
2 checks passed
pull-request-automation
Details
Travis CI - Pull Request Build Passed
Details
@jorgefilipecosta jorgefilipecosta deleted the fix/private-post-with-future-date-becomes-public-on-save branch Dec 2, 2019
@youknowriad youknowriad added this to the Gutenberg 7.1 milestone Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.