Changes between Version 2 and Version 3 of Ticket #47443, comment 10
- Timestamp:
- 01/24/2020 09:46:04 PM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #47443, comment 10
v2 v3 1 Uploaded a patch with a slight modification to the switch statement in ''wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php''. I found that it was necessary to distinguish between the "publish" and "future" cases in order for all previous unit tests to pass. Otherwise, test_create_post_publish_without_permission() (line 2303 in ''tests/phpunit/tests/rest-api/rest-posts-controller.php'') fails. In this scenario with the previous patch, the role would still be allowed to publish posts, even though it loses the "publish_posts" capability, because it still retains the "edit_published_posts" capability. Also added a newunit test.1 Uploaded a new patch with a slight modification to the switch statement in ''wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php''. I found that it was necessary to distinguish between the "publish" and "future" cases in order for all previous unit tests to pass. Otherwise, test_create_post_publish_without_permission() (line 2303 in ''tests/phpunit/tests/rest-api/rest-posts-controller.php'') fails. In this scenario with the previous patch, the role would still be allowed to publish posts, even though it loses the "publish_posts" capability, because it still retains the "edit_published_posts" capability. Also added a unit test.