v1.8.2-beta
Pre-releaseThis is a followup to CME 1.8's support for users who can edit_published_posts but not publish_posts. This functioned as a workaround for native WordPress handling of those capabilities, which was reported as a WP bug on both Trac and Github:
https://wordpress.org/support/topic/allow-contributor-to-edit-published-posts-not-working-2/
However, this workaround caused the automatic publication of blank auto-saves on some sites. Other sites saw post save cause WooCommerce posts to be set to an invalid status.
The issues with version 1.8 were due to filtering the 'pre_post_status' value based on a post_id derived from the request parameters. The result was that the published status of the primary post was "restored" to the post being updated - which may have been an auto-draft, WooCommerce custom types or other supplemental posts updated within the request. This is no longer possible because the post_status value is only filtered based on the post_id passed directly into the 'edit_post_status' or 'wp_insert_post_data' filter.
Post ID is still derived from the query, but only for the purpose of publish_posts / edit_publish_posts capability checks.
This will be released as a beta version initially. As an ongoing precaution, the entire edit_published_posts workaround can be disabled by defining the following constant:
define('CME_DISABLE_WP_EDIT_PUBLISHED_WORKAROUND', true);