#31635 closed defect (bug) (fixed)
Bulk Edit -> Publish should publish scheduled posts
Reported by: | siobhan | Owned by: | oglekler |
---|---|---|---|
Milestone: | 6.3 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Quick/Bulk Edit | Keywords: | has-patch has-unit-tests commit has-screenshots |
Focuses: | ui | Cc: |
Description
Here's the flow that I was working through:
- Scheduled about 15 posts to be published on the site at a later date.
- Decided I wanted to just publish them now.
- Used Bulk Edit to change the status of all of the posts to published. Saved
- Went about my business thinking they were published
- Later visited the site and they weren't published.
6 Went back into the posts and they're still marked as scheduled.
- Had to manually go in and change the date on each post to get them published.
This was really, really annoying. Especially since, as I was able to take the action of Bulk Edit -> change status to published, I thought that what I had done had worked. There was no indication that it hadn't.
This could be solved in a number of ways:
- If a user bulk edits and selects publish, the date on the post is changed to the current date and time and the posts are published as expected.
- If posts are scheduled and the user selects them to bulk edit, there is no option to change the status to published.
- If the user takes the action of trying to change the status of scheduled posts to published, the message is changed from "# Posts Updated" to "Scheduled posts have not been published."
Attachments (4)
Change History (30)
#3
@
22 months ago
- Keywords needs-patch added; make-flow removed
Component ticket review today
- @webcommsat @oglekler @nalininontopsnewsuk
All reported this problem occurs: 5.9, 6.0, 6.1.1.
@siobhan has highlighted three ways of addressing this bug. Option 1 would be the most preferable.
We suggested that if the solution for option 1 was not possible quickly, in the interim whether a patch just adding the wording in Option 3 so users knew that the posts were not published using 'Bulk Edit'.
Ticket updated as needing a patch.
Update: this ticket will be one of the ones @oglekler will be working on and inviting others who wish to work to do so with her at WordCamp Asia on February 17, 2023. People can also assist on Slack.
This ticket was mentioned in Slack in #core by abhanonstopnews. View the logs.
22 months ago
This ticket was mentioned in PR #4237 on WordPress/wordpress-develop by @cadic.
21 months ago
#5
- Keywords has-patch has-unit-tests added; needs-patch removed
Updated bulk_edit_posts()
: scheduled posts will be published immediately if post status is set to "publish" on the bulk edit.
Added unit tests to cover this behaviour
Trac ticket: https://core.trac.wordpress.org/ticket/31635
#8
@
21 months ago
Thank you @cadic,
I've tested the patch with WordPress 6.3-alpha-55505-src.
This Patch (and related unit test) look fine and work as expected.
I am wondering if we need to change the post date for posts we are publishing from drafts if it is in the past or not, but I assume this is out of the scope for this ticket.
#9
@
21 months ago
@oglekler yes, it looks out of scope to assign current time as post_date of posts being published from drafts during bulk edit.
It may be an easy adjustment within the current change (and will also worth adding another unit test case)
diff --git a/src/wp-admin/includes/post.php b/src/wp-admin/includes/post.php index 0c9f9250ed..bdb07604a4 100644 --- a/src/wp-admin/includes/post.php +++ b/src/wp-admin/includes/post.php @@ -665,7 +665,7 @@ function bulk_edit_posts( $post_data = null ) { unset( $post_data['tax_input']['post_format'] ); // Reset post date of scheduled post to be published. - if ( 'future' === $post->post_status && 'publish' === $post_data['post_status'] ) { + if ( in_array( $post->post_status, array( 'future', 'draft' ), true ) && 'publish' === $post_data['post_status'] ) { $post_data['post_date'] = current_time( 'mysql' ); $post_data['post_date_gmt'] = ''; }
#10
@
21 months ago
Thank you, @cadic, I believe that it makes sense. When user is publishing something, he/she expects this to be fresh on the block news and not be published on time what it was drafted. I imagine that user can prepare something and sitting on it waiting for right timing and then publish. If the time gap is not big he/she cannot even notice that it was published at past but in some cases date is matter for users and SEO as well and inaccurate dates can be potentially looks like tricks from the site owner or caching bug.
#11
@
21 months ago
Thank you @cadiac for the patch. I have tested it like @oglekler (thank you too for testing and comments), and found no issues.
The second issue about the publication date would be useful to have addresses, and I agree this would need to be in an additional ticket. I would second Olga's comments on tihs.
#12
@
21 months ago
@webcommsat thanks for the feedback. I've already updated the patch and unit tests: it will apply the date reset to drafts as well when bulk publishing.
Please feel free to link the existing PR to a new issue whoever creates it.
#13
@
21 months ago
@cadic @webcommsat,
I've created a new ticket #57947 to address the Draft state issue, but I agree that it is easier to tackle this with one patch not to have margin issues or duplicate a code.
Thank you 🙏
#14
@
21 months ago
We need to get some more tests on this and the updated patch. Thanks @cadic for all the additional changes.
I will put it on the dev chat agenda this coming week. Let's hope this can be moved forward for 6.3.
Once we have the updated patch tests done, we can mark the other ticket opened as a duplicate, if it is no longer needed. Thanks @cadic and @oglekler , it is so good to see this ticket moving forward.
@marybaum can you please also add this to your list for testing. Thanks.
This ticket was mentioned in Slack in #core by oglekler. View the logs.
19 months ago
#17
@
19 months ago
Hi,
Tested the patch - https://core.trac.wordpress.org/attachment/ticket/31635/31635-2.patch. It is working fine while change the status of selected multiple posts. However, If try to quick edit a single post it is not working. Added the screencast below-
https://drive.google.com/file/d/1ShSndAiRzEihIri8ZbwH6IbzhMyq2wyw/view?usp=sharing
#18
@
18 months ago
Hi, I tested the patch (WP 6.3-alpha-55505-src) and from my point of view behaviour with posts which are scheduled for the future is expected, video: https://disk.yandex.ru/i/p2YQYpu3DRADSg
There was another patch which was fixing this Published/Scheduled option text, and it looks like it is in the trunk now.
#20
@
17 months ago
- Keywords commit added
I've tested the patch again, and it is working as expected in the scope of the ticket and has unit tests, I am marking this for review to commit.
#21
@
17 months ago
- Keywords has-screenshots added; needs-testing removed
Self assigning for commit
.
This ticket was mentioned in PR #4774 on WordPress/wordpress-develop by @audrasjb.
17 months ago
#22
@audrasjb commented on PR #4774:
17 months ago
#25
committed in https://core.trac.wordpress.org/changeset/56123
@audrasjb commented on PR #4237:
17 months ago
#26
committed in https://core.trac.wordpress.org/changeset/56123
Changing the ticket type of this to a bug, as the behavior is as expected (published a scheduled post) in the quick edit as well, which is essentially bulk-edit for a singular post