Opened 3 years ago
Last modified 2 years ago
#54983 new defect (bug)
The post has already been deleted.
Reported by: | sumitsingh | Owned by: | |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | 5.4 |
Component: | Posts, Post Types | Keywords: | has-screenshots has-patch has-testing-info needs-testing dev-feedback |
Focuses: | administration | Cc: |
Description
Hi,
One big issue on 5.9 . when i have deleted post then still on post page & getting error message "The post has already been deleted.". So i think after delete post need to redirect page on post list?
More infomation you can see below mentioned quick video.
https://www.loom.com/share/616020077274422c8d90771034d22aff
Attachments (2)
Change History (26)
This ticket was mentioned in Slack in #core by sumitsingh. View the logs.
3 years ago
#4
@
3 years ago
Our step like this :)
Steps to Reproduce
- Navigate to Dashboard > Quick Draft > Save Draft with enter anythings.
- Click on (no title) and will open edit post screen.
- On the Posts screen, Move to trash the post and still yuo will on edit post .
- Then try to again click on Move to trash then you will get error message "The post has already been deleted.".
#5
follow-up:
↓ 6
@
3 years ago
@sumitsingh Thanks for posting the steps to reproduce!
I can confirm that this issue only seems to occur when the post has no title and no content.
This does not occur when using the Classic Editor.
This still occurs with Gutenberg 12.4.1 activated.
This was unfortunately not covered for another issue with the "Move to trash" button in GB 17426.
@sumitsingh Can you double-check if this issue has been reported in the Gutenberg repo and if it hasn't, please open a bug report issue and comment here with a link to the issue?
In terms of the Quick Draft
feature allowing a post with no title or content to be created:
- This was introduced in 47191.
- This change wrapped the content in a paragraph block if it didn't already contain one.
- However, it did not confirm that there was any content to begin with.
I have reopened #48120 to address the regression.
#6
in reply to:
↑ 5
@
3 years ago
I know about above but this is diffrent issue. here after click on Move to trash then show message or should be redirect on listing page @costdev . more information check my video on first comment. i think we need to set validation for atleast title for create post?
Replying to costdev:
@sumitsingh Thanks for posting the steps to reproduce!
I can confirm that this issue only seems to occur when the post has no title and no content.
This does not occur when using the Classic Editor.
This still occurs with Gutenberg 12.4.1 activated.
This was unfortunately not covered for another issue with the "Move to trash" button in GB 17426.
@sumitsingh Can you double-check if this issue has been reported in the Gutenberg repo and if it hasn't, please open a bug report issue and comment here with a link to the issue?
In terms of the
Quick Draft
feature allowing a post with no title or content to be created:
- This was introduced in 47191.
- This change wrapped the content in a paragraph block if it didn't already contain one.
- However, it did not confirm that there was any content to begin with.
I have reopened #48120 to address the regression.
#7
@
3 years ago
It's acceptable to create a post with no title OR no content, but wp_insert_post()
does not allow a post to have no title AND no content.
<?php $new_post = wp_insert_post( array( 'post_title' => '', 'post_content' => '' ) ); var_dump( $new_post ); // Will be (int) 0
However, the change in 47191 turns ''
into <!-- wp:paragraph --><!-- /wp:paragraph -->
for Quick Drafts, which means the post now has content and gets created. I submitted a patch to #48120 to resolve this, but I will move it to this ticket instead.
@
3 years ago
Quick Draft: Add a check for $_POST['content']
before wrapping in Paragraph block markup.
#11
@
3 years ago
Hi there!
54983_add_content_check.diff Is working fine and not allow to create Draft post without Post content.
Here can we show an alert message that tells the user that you have to add content to create a new Draft Post because no one understood what happen when they click on the Save Draft button
#12
@
3 years ago
@mukesh27 After reading your comment, I went on the hunt for similar alert messages in Core for consistency. I couldn't find any that would appear in the form, except for red outlines added to the inputs. Highlighting both inputs wouldn't be accurate, as only one is needed for a valid post.
Alternatively, disabling the Submit
button until the draft has either a title or content would be consistent with how the Block Editor works. I'll attach a patch for testing and review (remember to npm run build:dev
).
#13
@
3 years ago
- Keywords has-patch has-testing-info needs-testing added
- Severity changed from major to normal
- Version changed from 5.9 to 5.4
Patch still applies cleanly against trunk
.
This ticket was mentioned in Slack in #core-test by boniu91. View the logs.
3 years ago
#15
@
3 years ago
As @costdev have mentioned earlier in his comment, I would also like confirm that this issue only seems to occur when the post has no title and no content.
This ticket was mentioned in Slack in #core-test by boniu91. View the logs.
2 years ago
#17
@
2 years ago
@costdev I tried to test the fix for QuickDraft, but it doesn't seem to wrok for me:
https://www.loom.com/share/33e5beb26c7346bf955f5bb82974ea0b
It's on the
54983.disable-submit.diff
#18
@
2 years ago
- Keywords dev-feedback added
@Boniu91 I agree with you. I have tested it also seems like not working for me.
@sumitsingh Also noticed that on first click no action is reflecting on the screen or redirecting to post list page. On second click it's displaying the message.
The post has already been deleted.
Please follow this screencast to view this actual behavior.
https://watch.screencastify.com/v/Z5caqJLwzULQRn3w2CRD
Tested on: WordPress version (6.0-beta2-53262)
This ticket was mentioned in Slack in #core-test by rinkychowdhury9. View the logs.
2 years ago
This ticket was mentioned in Slack in #core by chaion07. View the logs.
2 years ago
#23
@
2 years ago
- Milestone changed from 6.0 to 6.1
With 6.0 RC1 starting soon, I'm moving this to the 6.1 milestone.
Our step like this :).
Steps to Reproduce