#59125 closed defect (bug) (fixed)
Quick editing date of draft post does not work
Reported by: | tristanleboss | Owned by: | joedolson |
---|---|---|---|
Milestone: | 6.4 | Priority: | normal |
Severity: | normal | Version: | 6.3 |
Component: | Quick/Bulk Edit | Keywords: | has-patch has-unit-tests has-testing-info commit |
Focuses: | javascript | Cc: |
Description
Hello,
Using a fresh WP 6.3 setup with no plugins nor themes:
- create a draft post
- go back to the list of post
- quick edit this post and change the date post year (for example)
- press the "Save" button
- the save succeed but the date is not saved: the date is still the old one
It's an unexpected behavior. 1) You can clearly edit the date in the UI. 2) It's perfectly sane to want to set a draft date so you know when you will have the post published in the future.
I maybe wrong but I have the feeling it's missing "hidden_(aa|jj|mm|hh|mn|ss)" hidden input fields. Indeed, in the _wp_translate_postdata
function, to be able to trigger the edit date code, it needs those fields. There is a foreach checking for their existence.
Attachments (3)
Change History (26)
#2
@
16 months ago
- Summary changed from Quick editing date of draf post does not work to Quick editing date of draft post does not work
#3
follow-up:
↓ 7
@
16 months ago
- Component changed from General to Quick/Bulk Edit
- Focuses javascript added
- Keywords needs-patch added
#4
@
16 months ago
Today, changing the date field of the Quick Edit panel of a draft post does absolutely nothing.
No date is changed in the database: post_date and post_modified are just changed with the current date.
Changing the date from the post edit page still works if you use the Classic Editor plugin.
What I don't understand is why such a change was done in the first place. It has been like that for 12 years and, all of a sudden, the behavior changes without any UX change. The #19907 ticket just collected 26 comments in 12 years so clearly not a problem for many users.
When you create content, you sometime know when you want to publish it (a news, a paid content, ...) so it was very convenient to be able to preset the publish date.
I think the best solution was just to leave the date fields empty when post_status === draft and post_date === post_modified. This way, you can set a date in Quick Edit panel or decide to keep it in sync with post_modified which means it will be published with the current date when the user will click the publish button.
Or, do a bit like the Classic Editor which shows "Publish : immediatly [Edit]" with the edit button to set a custom date. It can be exactly the same way in the Quick Edit panel of a draft post... maybe instead of "immediatly" use a sentence that says the date will be the one when the post is published. I don't know how to phrase it in English: "use date at the time of publication"?
#6
@
16 months ago
I can confirm that this has also caused some problems for some of our users. For example, we have one site where the post times were manually set to enforce ordering of a multi-page publication. We have "got around it" by _scheduling_ publication at various times, which should result in the public seeing everything correctly, but it made reviewing the drafts difficult because we could not get them in the correct order prior to publication. The problem "fixed" in #19907 has had what I think are unintended consequences.
#7
in reply to:
↑ 3
@
16 months ago
Replying to sabernhardt:
If I understand #19907 correctly, the Quick Edit feature needed to prevent setting the date unintentionally. However, r56022 does not allow setting a date/time you want in Quick Edit.
Indeed, this appears to be a regression, as the change does not account for setting the date explicitly when needed.
This ticket was mentioned in PR #5025 on WordPress/wordpress-develop by @ivanzhuck.
16 months ago
#8
- Keywords has-patch added; needs-patch removed
Hello,
I've added a condition to _wp_translate_postdata()
which allow to save the date for draft posts with the quick edit form.
Please review.
#9
@
16 months ago
This issue was also reported in the forums at https://wordpress.org/support/topic/posts-screen-quick-edit-cannot-change-date/
#10
@
16 months ago
- Milestone changed from 6.3.1 to 6.3.2
WP 6.3.1 is going to be released in the next few days, so let's move this ticket to 6.3.2 to give it more time to be committed and backported.
This ticket was mentioned in PR #5062 on WordPress/wordpress-develop by @khokansardar.
16 months ago
#12
This PR fix draft post date change save issues in quick edit, considering ticket #59125 issue and previously ticket task #19907 done patch which create issues ( not updating date/time ) for post status - ( 'draft', 'pending', 'auto-draft' ).
Trac ticket: https://core.trac.wordpress.org/ticket/59125
@
16 months ago
With this patch posts shouldn't be assigned a date unless date explicitly done by the user when needed.
This ticket was mentioned in Slack in #core by joemcgill. View the logs.
14 months ago
This ticket was mentioned in PR #5358 on WordPress/wordpress-develop by @joedolson.
14 months ago
#16
- Keywords has-unit-tests added
This is a fresh PR based on 5062 but built on current trunk
Trac ticket: https://core.trac.wordpress.org/ticket/59125
#17
@
14 months ago
- Keywords has-testing-info added; dev-feedback removed
PR 5025 just reverses in PHP the change made in JS, so it still causes the original problem from #19907. So I don't think that's a viable fix.
PR 5062, however, does fix both the original problem and the new issue. However, it needs tests updates. Whether or not quick edit saves a post date is now conditional on whether a date was passed that's different from the previous date, and the test passes a new value. I've added new tests and rebased the PR on trunk.
Testing:
1) Confirm that the test in #19907 result in an unchanged post date.
2) Confirm that the test steps in this report result in a changed post date.
This ticket was mentioned in Slack in #core by audrasjb. View the logs.
14 months ago
#19
@
14 months ago
- Milestone changed from 6.3.2 to 6.4
Given this still needs testing and because we're close to 6.3.2 release candidate, let's move this ticket to milestone 6.4.
#20
@
14 months ago
Test Report
Patch Tested: https://github.com/WordPress/wordpress-develop/pull/5062
Environment:
WordPress - 6.4 beta2
OS - Windows
Browser - Chrome
PHP - 8.1.2
Active Plugin - None
Actual Results:
- ✅ After Applying Patch Draft post's date change is now working in Quick Edit
#21
@
14 months ago
- Keywords commit added; needs-testing removed
Although the test above was done against PR 5062, this is a valid test, since the only difference between 5062 and 5358 is that the latter is based on a refreshed version of trunk, so it's less out of date. The changes in the two PRs are identical.
@joedolson commented on PR #5358:
14 months ago
#23
In r56802
If you still use "Classic Editor" plugin, you can still edit the date. I didn't find a way to set the date using Gutenberg.