#19907 closed defect (bug) (fixed)
Updating an unpublished draft post in quick-edit mode sets the post's publish date
Reported by: | uxtremist | Owned by: | joedolson |
---|---|---|---|
Milestone: | 6.3 | Priority: | normal |
Severity: | major | Version: | 2.7 |
Component: | Quick/Bulk Edit | Keywords: | has-patch editorial-flow has-unit-tests needs-testing commit |
Focuses: | Cc: |
Description
Problem:
- If you update an unpublished draft post in quick-edit mode, the post's publish date is saved.
- Then, later on, when you actually publish the post, its publish date is incorrect.
Suggested fix:
- If the post is a draft, do not automatically set the post's publish date in quick-edit mode.
Steps to reproduce:
(1) Go to WP-Admin -> Posts.
(2) Create and save a new post. Make sure you click "Save Draft" — not "Publish".
(3) Note that the post is marked as "Publish immediately"; that is, it has no publish date.
(4) Go back to WP-Admin -> Posts.
(5) Hover your pointer over the post you just created. Click "Quick Edit".
— Note that in the panel that appears, the "Date" field is automatically set to [the current date and time].
(6) Click "Update" in quick-edit mode.
(7) Hover your pointer over the post you just updated. Click "Edit".
— Note that in the Edit Post page that appears, the post is now marked as "Publish on: [the date and time from step (5)]"
Attachments (4)
Change History (46)
#1
@
13 years ago
- Milestone changed from Awaiting Review to 3.4
- Severity changed from normal to major
#2
@
13 years ago
- Keywords has-patch added; needs-patch removed
- Version changed from 3.3.1 to 2.7
#3
@
13 years ago
- Keywords ux-feedback removed
I don't know that I'd call it major, since it's been there since 2.7, but the desired behavior is that when using quick edit when a post is a draft, it should adjust 'last edited' not 'publish' time.
@
11 years ago
Alternative fix, which also fixes the issue when a draft post is trashed or untrashed
#16
@
11 years ago
Patch will need to be rewritten to apply cleanly with the current core php brace syntax mandate. Anyone want easy props to rewrite?
This ticket was mentioned in IRC in #wordpress-dev by DrewAPicture. View the logs.
10 years ago
#20
@
10 years ago
- Milestone changed from 4.0 to Future Release
Patch applies with fuzz. Still needs unit tests. Punting.
#25
@
4 years ago
Wow, 9 years!
Because of this issue inserting tags on Gutenberg, I almost prefer to insert them using the quick editor.
That way, this does bug me quite a lot. Hope it gets fixed soon.
#26
@
4 years ago
- Keywords has-unit-tests added; needs-unit-tests needs-refresh removed
I can still reproduce the issue on trunk version.
I tested the first implementation by @SergeyBiryukov but it doesn't seem to work for me. So I tested the second implementation and it worked. But I'm afraid the patch might have some regressions.
There are two failing unit tests with the second patch:
Tests_XMLRPC_wp_newPost::test_valid_string_post_date_gmt Tests_XMLRPC_wp_newPost::test_valid_IXR_post_date_gmt --- Expected +++ Actual @@ @@ -'1984-01-11 05:00:00' +'0000-00-00 00:00:00'
I also tried to create a unit test dedicated to this ticket, a bit struggling as it's an AJAX request but I think I have something working.
Be cautious this patch is not ready to be committed as the XMLRPC is impacted. Let's get some feedback
This ticket was mentioned in Slack in #core by abhanonstopnews. View the logs.
3 years ago
#28
@
21 months ago
- Milestone changed from Future Release to 6.3
- Owner set to joedolson
- Status changed from new to accepted
I'm going to tackle this for 6.3; it would go nicely along with some related tickets I've already committed this cycle.
This ticket was mentioned in PR #4262 on WordPress/wordpress-develop by rutviksavsani.
21 months ago
#29
Trac ticket:
rutviksavsani commented on PR #4262:
21 months ago
#30
Closing the Pull request.
This ticket was mentioned in Slack in #core by oglekler. View the logs.
18 months ago
This ticket was mentioned in PR #4533 on WordPress/wordpress-develop by @rutviksavsani.
18 months ago
#32
Trac ticket: https://core.trac.wordpress.org/ticket/19907
In this PR, we are disabling saving of date when a draft
post is being saved in the quik-editor for posts.
#33
@
18 months ago
- Keywords needs-testing added
I have added a PR https://github.com/WordPress/wordpress-develop/pull/4533 that should fix the issue.
Edit:
As expected this was not a total PHP backend fix, As We needed to tweak the JS to pass edit_date param as false. By default it always passed true and that was the reason the date was getting updated.
#34
@
18 months ago
Hi @rutviksavsani, thank you for the patch.
I tested it, and it looks like we still have the date settled after a quick edit update.
Video: https://disk.yandex.ru/i/6n_PVNs2W_xZgA
#35
@
18 months ago
@rutviksavsani, sorry for the inconvenience, I forgot to run a build 🤦 but even after this I managed to get expected result from the second attempt after clearing browser's cache. So, right now this is an issue if fixed with the patch ✅
Thank you 🙏
This ticket was mentioned in PR #4686 on WordPress/wordpress-develop by @joedolson.
18 months ago
#36
This is for testing the tests being added for 19907. Should fail.
Trac ticket: https://core.trac.wordpress.org/ticket/19907
#37
@
18 months ago
- Keywords commit added
New PR merges @ruviksavsani's PR with the tests added by @Mista-Flo (with a minor tweak).
@joedolson commented on PR #4533:
18 months ago
#39
Fixed in r56022
@joedolson commented on PR #4686:
18 months ago
#40
Closed in r56022
#41
@
16 months ago
I am not sure this ticket was implemented the right way.
See my comment here: https://core.trac.wordpress.org/ticket/59125#comment:4
Has been this way since Quick Edit was introduced in 2.7 (#8144).
The problem is that
edit_date
is true by default:http://core.trac.wordpress.org/browser/tags/3.3.1/wp-admin/js/inline-edit-post.dev.js#L238
And the condition for
$clear_date
inwp_update_post()
is not satisfied:http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/post.php#L2693
19907.patch brings the similar check and comment into
edit_post()
.19907.2.patch sets
edit_date
to false instead ofpost_date_gmt
.