Changes between Version 1 and Version 2 of Ticket #47443, comment 10
- Timestamp:
- 01/24/2020 09:40:06 PM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #47443, comment 10
v1 v2 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 , 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 new unit test.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 new unit test.