Skip to content

Commit

Permalink
Merge pull request #393 from publishpress/release-2.5.3
Browse files Browse the repository at this point in the history
Release 2.5.3
  • Loading branch information
agapetry authored Apr 6, 2021
2 parents f8196b1 + f054df7 commit 6f173df
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 9 deletions.
6 changes: 6 additions & 0 deletions admin/admin_rvy.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,12 @@ public function fltDisableStatusControlScripts($enable_scripts) {
}

public function fltDisableExceptionUI($disable, $src_name, $post_id, $post_type = '') {
global $pagenow;

if (!empty($pagenow) && ('term.php' == $pagenow)) {
return $disable;
}

if (!$post_id) {
// Permissions version < 3.1.4 always passes zero value $post_id
$post_id = rvy_detect_post_id();
Expand Down
2 changes: 2 additions & 0 deletions admin/revision-action_rvy.php
Original file line number Diff line number Diff line change
Expand Up @@ -1100,6 +1100,8 @@ function rvy_publish_scheduled_revisions($args = array()) {
// if it was not stored, or cleared, use default recipients
$to_addresses = array();

do_action('presspermit_init_rvy_interface');

if ( defined('RVY_CONTENT_ROLES') && ! defined('SCOPER_DEFAULT_MONITOR_GROUPS') && ! defined('REVISIONARY_LIMIT_ADMIN_NOTIFICATIONS') ) { // e-mail to Scheduled Revision Montiors metagroup if Role Scoper is activated
global $revisionary;

Expand Down
8 changes: 7 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Tags: revision, submit changes, workflow, collaboration, permissions, moderate,
Requires at least: 4.9.7
Requires PHP: 5.6.20
Tested up to: 5.7
Stable tag: 2.5.2
Stable tag: 2.5.3
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -104,6 +104,12 @@ Follow PublishPress on [Facebook](https://www.facebook.com/publishpress), [Twitt

== Changelog ==

= 2.5.3 - 5 Apr 2021 =
* Compat : WP Rest Cache - Revision submission from Gutenberg failed
* Compat : PublishPress Permissions - Edit Category / Term: Permissions metaboxes were not displayed
* Compat : PublishPress Permissions - Pending Revision Monitors group ineffective; notifications were sent to all Editors and Administrators (also requires PublishPress Permissions 3.5.1)
* Compat : Enable revisioning of non-public post types if they have type-specific capabilities defined

= 2.5.2 - 30 Mar 2021 =
* Fixed : Fatal error due to incorrect vendor library load request

Expand Down
4 changes: 2 additions & 2 deletions revision-creation_rvy.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ function flt_pending_revision_data( $data, $postarr ) {
if ( $revisionary->isBlockEditorActive() && !$revisionary->doing_rest ) {
if (!empty($_REQUEST['meta-box-loader']) && !empty($_REQUEST['action']) && ('editpost' == $_REQUEST['action'])) {
// Use logged revision ID from preceding REST query
if (!$revision_id = rvy_get_transient("_rvy_pending_revision_{$current_user->ID}_{$postarr['ID']}")) {
if (!$revision_id = (int) rvy_get_transient("_rvy_pending_revision_{$current_user->ID}_{$postarr['ID']}")) {
return $data;
}
} else {
Expand Down Expand Up @@ -515,7 +515,7 @@ function flt_create_scheduled_rev( $data, $post_arr ) {
if ( $revisionary->isBlockEditorActive() && !$revisionary->doing_rest ) {
if (!empty($_REQUEST['meta-box-loader']) && !empty($_REQUEST['action']) && ('editpost' == $_REQUEST['action'])) {
// Use logged revision ID from preceding REST query
if (!$revision_id = rvy_get_transient("_rvy_scheduled_revision_{$current_user->ID}_{$post_arr['ID']}")) {
if (!$revision_id = (int) rvy_get_transient("_rvy_scheduled_revision_{$current_user->ID}_{$post_arr['ID']}")) {
return $data;
}
} else {
Expand Down
2 changes: 2 additions & 0 deletions revision-workflow_rvy.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,8 @@ static function getRecipients($notification_class, $args) {
case 'rev_submission_notify_admin' :
case 'rev_approval_notify_admin' :

do_action('presspermit_init_rvy_interface');

if ( defined('RVY_CONTENT_ROLES') && ! defined('SCOPER_DEFAULT_MONITOR_GROUPS') && ! defined('REVISIONARY_LIMIT_ADMIN_NOTIFICATIONS') ) {
global $revisionary;

Expand Down
6 changes: 3 additions & 3 deletions revisionary.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: Maintain published content with teamwork and precision using the Revisions model to submit, approve and schedule changes.
* Author: PublishPress
* Author URI: https://publishpress.com
* Version: 2.5.2
* Version: 2.5.3
* Text Domain: revisionary
* Domain Path: /languages/
* Min WP Version: 4.9.7
Expand Down Expand Up @@ -96,7 +96,7 @@ function($links, $file)
// register these functions before any early exits so normal activation/deactivation can still run with RS_DEBUG
register_activation_hook(__FILE__, function()
{
$current_version = '2.5.2';
$current_version = '2.5.3';

$last_ver = get_option('revisionary_last_version');

Expand Down Expand Up @@ -172,7 +172,7 @@ function()
return;
}

define('REVISIONARY_VERSION', '2.5.2');
define('REVISIONARY_VERSION', '2.5.3');

if ( ! defined( 'RVY_VERSION' ) ) {
define( 'RVY_VERSION', REVISIONARY_VERSION ); // back compat
Expand Down
19 changes: 17 additions & 2 deletions revisionary_main.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ function configurationLateInit() {
}

// This is intentionally called twice: once for code that fires on 'init' and then very late on 'init' for types which were registered late on 'init'
private function setPostTypes() {
$this->enabled_post_types = apply_filters(
public function setPostTypes() {
$enabled_post_types = apply_filters(
'revisionary_enabled_post_types',
array_diff_key(
array_merge(
Expand All @@ -182,6 +182,21 @@ private function setPostTypes() {
)
);

if (!defined('REVISIONARY_NO_PRIVATE_TYPES')) {
$private_types = get_post_types(['public' => false], 'object');

// by default, enable non-public post types that have type-specific capabilities defined
foreach($private_types as $post_type => $type_obj) {
if ((!empty($type_obj->cap) && !empty($type_obj->cap->edit_posts) && !in_array($type_obj->cap->edit_posts, ['edit_posts', 'edit_pages']))
|| defined('REVISIONARY_ENABLE_' . strtoupper($post_type) . '_TYPE')
) {
$enabled_post_types[$post_type] = true;
}
}
}

$this->enabled_post_types = array_merge($this->enabled_post_types, $enabled_post_types);

unset($this->enabled_post_types['attachment']);
$this->enabled_post_types = array_filter($this->enabled_post_types);
}
Expand Down
4 changes: 3 additions & 1 deletion rvy_init.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,14 @@ function rvy_get_transient($transient) {

$option_name = '_transient_' . $transient;

return $wpdb->get_var(
$val = $wpdb->get_var(
$wpdb->prepare(
"SELECT option_value FROM $wpdb->options WHERE option_name = %s",
$option_name
)
);

return (is_null($val)) ? '' : $val;
}

function rvy_set_transient($transient, $option_val, $timeout = 30) {
Expand Down

0 comments on commit 6f173df

Please sign in to comment.