Opened 7 weeks ago
Last modified 3 weeks ago
#64025 new enhancement
wp_die() status code posts component updates (parent ticket: #64009)
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Future Release | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Posts, Post Types | Keywords: | has-patch needs-testing has-test-info |
| Focuses: | Cc: |
Description
If you have come here directly, please refer back to the parent ticket here: #64009
This ticket is regarding the wp_die() function calls within the Media component and will cover the following locations. Please note links were correct at the time of testing and writing this up, but line numbers may have changed slightly:
| Filepath | Line Number | Context | Status Code | New Code | Code Meaning |
| src/wp-admin/post-new.php | 24 | GET: Invalid post type passed | 500 | 400 | Bad Request |
| src/wp-admin/term.php | 31 | Missing: item for edit | 500 | 404 | Not Found |
| src/wp-admin/includes/post.php | 286 | User Permissions: does not have access | 500 | 403 | Forbidden |
| src/wp-admin/includes/post.php | 288 | User Permissions: does not have access | 500 | 403 | Forbidden |
| src/wp-admin/includes/post.php | 519 | User Permissions: does not have access | 500 | 403 | Forbidden |
| src/wp-admin/includes/post.php | 521 | User Permissions: does not have access | 500 | 403 | Forbidden |
| src/wp-admin/includes/post.php | 2084 | Missing: post | 500 | 404 | Not Found |
| src/wp-admin/includes/post.php | 2088 | User Permissions: does not have access | 500 | 403 | Forbidden |
| src/wp-admin/edit-tags.php | 13 | Error: Invalid taxonomy | 500 | 400 | Bad Request |
| src/wp-admin/edit-tags.php | 19 | Error: Invalid taxonomy | 500 | 400 | Bad Request |
| src/wp-admin/edit-tags.php | 23 | User Permissions: does not have access | 500 | 403 | Forbidden |
| src/wp-admin/edit-tags.php | 160 | User Permissions: does not have access | 500 | 403 | Forbidden |
| src/wp-admin/edit-tags.php | 180 | Missing: term | 500 | 404 | Not Found |
| src/wp-admin/comment.php | 46 | Error: cannot edit as post is in trash | 500 | 409 | Conflict |
| src/wp-admin/comment.php | 384 | REQUEST: invalid params | 500 | 400 | Bad Request |
| src/wp-admin/edit.php | 18 | REQUEST: invalid params | 500 | 400 | Bad Request |
| src/wp-admin/edit.php | 22 | User Permissions: does not have access | 500 | 403 | Forbidden |
| src/wp-admin/edit.php | 41 | REQUEST: invalid params | 500 | 400 | Bad Request |
| src/wp-admin/edit.php | 123 | REQUEST: invalid params | 500 | 400 | Bad Request |
| src/wp-admin/edit.php | 156 | User Permissions: does not have access | 500 | 403 | Forbidden |
| src/wp-admin/edit.php | 176 | User Permissions: does not have access | 500 | 403 | Forbidden |
There are however the following function calls I have not touched as I felt they were already valid with their current status code:
| Filepath | Line Number | Status Code |
| src/wp-admin/comment.php | 364 | 500 |
| src/wp-admin/edit-comments.php | 12 | 403 |
| src/wp-admin/edit-tags.php | 23 | 500 |
| src/wp-admin/edit-tags.php | 27 | 403 |
| src/wp-admin/edit-tags.php | 84 | 403 |
| src/wp-admin/edit-tags.php | 115 | 403 |
| src/wp-admin/edit-tags.php | 135 | 403 |
| src/wp-admin/edit-tags.php | 171 | 403 |
| src/wp-admin/edit.php | 45 | 403 |
| src/wp-admin/edit.php | 132 | 500 |
| src/wp-admin/edit.php | 160 | 500 |
| src/wp-admin/edit.php | 181 | 500 |
| src/wp-admin/edit.php | 185 | 500 |
| src/wp-admin/includes/post.php | 326 | 500 |
| src/wp-admin/includes/post.php | 987 | 500 |
| src/wp-admin/includes/post.php | 2108 | 500 |
| src/wp-admin/post-new.php | 59 | 403 |
| src/wp-admin/post.php | 20 | 400 |
| src/wp-admin/post.php | 47 | 400 |
| src/wp-admin/term.php | 41 | 403 |
| src/wp-includes/comment.php | 749 | 409 |
| src/wp-includes/comment.php | 916 | 429 |
Please note that my suggestions were made before @johnbillion's comment on the parent ticket made here.
Change History (3)
This ticket was mentioned in PR #9997 on WordPress/wordpress-develop by @callumbw95.
7 weeks ago
#1
- Keywords has-patch added
#2
@
4 weeks ago
- Keywords needs-testing has-test-info added
- Milestone changed from Awaiting Review to Future Release
- Type changed from defect (bug) to enhancement
- Version trunk deleted
Testing Instructions
To test this, simply trigger any of the conditions for the error and check if the appropriate new code (not 500) is being logged in as expected. Any condition trigger will be fine to verify the whole patch.
…s related to the media component
Trac ticket: 64025