[wp-trac] [WordPress Trac] #52422: Create a draft with the same slug as an existing post, the existing post will be 404.
WordPress Trac
noreply at wordpress.org
Fri Apr 1 01:44:03 UTC 2022
#52422: Create a draft with the same slug as an existing post, the existing post
will be 404.
-------------------------------------------------+-------------------------
Reporter: Toro_Unit | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 6.0
Component: Posts, Post Types | Version:
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests needs- | Focuses:
refresh has-testing-info |
-------------------------------------------------+-------------------------
Changes (by costdev):
* keywords: has-patch has-unit-tests needs-refresh has-testing-info needs-
testing => has-patch has-unit-tests needs-refresh has-testing-info
Comment:
== Test Report
=== Environment
* Server: Apache (Linux)
* WordPress: 6.0-alpha-52448-src
* Browser: Chrome 99.0.4844.84
* OS: Windows 10
* Theme: Twenty Seventeen
* Plugins: None activated
=== Steps
1. Navigate to `Settings > Permalinks`.
2. Ensure the permalink structure is set to `Post name`. Click `Save
Changes`.
3. Navigate to `Posts > Add New`.
4. Name the post "Test post". Click `Publish`.
5. Navigate to `Posts > Add New`.
6. Name the post "Test post 2". Click `Save draft`.
7. On the right hand side, scroll down and edit the slug from "test-
post-2" to "test-post". Click "Save draft".
8. Navigate to `Posts`.
9. Click `View` on "Test post". Notice that the title is "Test post 2". ✅
10. Copy the link into a Private Browsing/Incognito window. Notice it
404s. ✅
11. Apply [https://github.com/WordPress/wordpress-develop/pull/1333 PR
1333].
12. Run `npm run build:dev`.
13. Trash and permanently remove "Test post" and "Test post 2".
14. Repeat steps 1-7. Notice that "test-post" changes to "test-post-2",
preventing the use of an existing slug. ✅
15. Continue to step 8 through 10. Notice that both issues in 9 and 10 no
longer occur. ✅
=== Results
1. Issue reproduced. ✅
2. [https://github.com/WordPress/wordpress-develop/pull/1333 PR 1333]
resolves the issue.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/52422#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list