Skip to content

Commit

Permalink
Merge pull request #1312 from publishpress/hotfix-1310-auto-submitted…
Browse files Browse the repository at this point in the history
…-revisions-no-notification

Hotfix 1310 auto submitted revisions no notification
  • Loading branch information
agapetry authored Jul 3, 2024
2 parents 4def8d2 + 7531281 commit 0029975
Show file tree
Hide file tree
Showing 15 changed files with 366 additions and 288 deletions.
2 changes: 1 addition & 1 deletion admin/admin-init_rvy.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ function rvy_admin_init() {
|| (isset($_REQUEST['action']) && in_array($_REQUEST['action'], ['decline_revision']))
) {
$doaction = (!empty($_REQUEST['action']) && !is_numeric($_REQUEST['action'])) ? sanitize_key($_REQUEST['action']) : sanitize_key($_REQUEST['action2']);

if (empty($_POST) && in_array($_REQUEST['action'], ['decline_revision'])) {
check_admin_referer('decline-revision');
} else {
Expand Down
2 changes: 1 addition & 1 deletion admin/class-list-table_rvy.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function __construct($args = []) {
}
}
}

foreach ($triggered_deletions as $revision_id => $post_id) {
if ($revision_id) {
wp_delete_post($revision_id, true);
Expand Down
10 changes: 5 additions & 5 deletions admin/history_rvy.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ function actCompareRevisionsTweakUI() {
|| (rvy_get_option('revision_restore_require_cap') && !current_user_can('administrator') && !is_super_admin() && !current_user_can('restore_revisions'))
) :
?>
<style type='text/css'>
input.restore-revision {display:none !important;}
</style>
<?php
<style type='text/css'>
input.restore-revision {display:none !important;}
</style>
<?php

endif;
endif;
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion admin/revision-action_rvy.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ function rvy_revision_create($post_id = 0, $args = []) {
if (!empty($args['force']) || current_user_can('copy_post', $main_post_id)) {
require_once( dirname(REVISIONARY_FILE).'/revision-creation_rvy.php' );
$rvy_creation = new PublishPress\Revisions\RevisionCreation();
$revision_id = $rvy_creation->createRevision($post_id, 'draft-revision', $args);

$revision_status = (rvy_get_option('auto_submit_revisions') && current_user_can('edit_post', $main_post_id)) ? 'pending-revision' : 'draft-revision';
$revision_id = $rvy_creation->createRevision($post_id, $revision_status, $args);
} else {
$revision_id = 0;
}
Expand Down
20 changes: 10 additions & 10 deletions admin/rvy_post-classic-edit.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ jQuery(document).ready( function($) {
}

function rvySchedulePost() {
var revisionaryScheduleDone = function () {
var revisionaryScheduleDone = function () {
$('.revision-schedule').hide();
$('.revision-scheduled-wrapper').show();

Expand All @@ -138,15 +138,15 @@ jQuery(document).ready( function($) {
$('div.rvy-creation-ui').html(rvyObjEdit.errorCaption);
}

var data = {'rvy_ajax_field': 'create_scheduled_revision', 'rvy_ajax_value': rvyObjEdit.postID, 'rvy_date_selection': RvyTimeSelection, 'nc': RvyGetRandomInt(99999999)};
var data = {'rvy_ajax_field': 'create_scheduled_revision', 'rvy_ajax_value': rvyObjEdit.postID, 'rvy_date_selection': RvyTimeSelection, 'nc': RvyGetRandomInt(99999999)};

$.ajax({
url: rvyObjEdit.ajaxurl,
data: data,
dataType: "html",
success: revisionaryScheduleDone,
error: revisionaryScheduleError
});
$.ajax({
url: rvyObjEdit.ajaxurl,
data: data,
dataType: "html",
success: revisionaryScheduleDone,
error: revisionaryScheduleError
});
}

$(document).on('click', '#normal-sortables input, #normal-sortables select', function() {
Expand Down Expand Up @@ -175,7 +175,7 @@ jQuery(document).ready( function($) {
wp.autosave.server.triggerSave();
} else {
rvySchedulePost();
}
}
});

$(document).on('click', '#post-body-content *, #content_ifr *, #wp-content-editor-container *, #tinymce *, #submitpost, span.revision-created', function() {
Expand Down
3 changes: 2 additions & 1 deletion admin/rvy_revision-classic-edit.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ jQuery(document).ready( function($) {
$(document).on('click', 'div.postbox-container', function() {
$('a.revision-approve, a.rvy-direct-approve').attr('disabled', 'disabled');
});
var rvyThumbnail = $('#set-post-thumbnail img').attr('src');

var rvyThumbnail = $('#set-post-thumbnail img').attr('src');

setInterval(function() {
if ($('#set-post-thumbnail img').attr('src') != rvyThumbnail) {
Expand Down
4 changes: 2 additions & 2 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ function rvy_revision_base_statuses($args = []) {
$arr = array_map('sanitize_key', (array) apply_filters('rvy_revision_base_statuses', ['draft', 'pending', 'future']));

if ('object' == $output) {
$status_keys = array_value($arr);
$status_keys = array_values($arr);
$arr = [];

foreach($status_keys as $k) {
Expand All @@ -236,7 +236,7 @@ function rvy_revision_statuses($args = []) {
$arr = array_map('sanitize_key', (array) apply_filters('rvy_revision_statuses', ['draft-revision', 'pending-revision', 'future-revision']));

if ('object' == $output) {
$status_keys = array_value($arr);
$status_keys = array_values($arr);
$arr = [];

foreach($status_keys as $k) {
Expand Down
Binary file modified languages/revisionary-es_ES.mo
Binary file not shown.
Loading

0 comments on commit 0029975

Please sign in to comment.