From a2a3a5764c6c87032b35d26c7292faddb497fd76 Mon Sep 17 00:00:00 2001 From: tonatos Date: Tue, 5 Aug 2014 17:48:20 +0600 Subject: [PATCH 1/2] Fix save mutate_content form on press Enter in input field --- manager/actions/mutate_content.dynamic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/actions/mutate_content.dynamic.php b/manager/actions/mutate_content.dynamic.php index 1083c08029..789d5d90d4 100644 --- a/manager/actions/mutate_content.dynamic.php +++ b/manager/actions/mutate_content.dynamic.php @@ -494,7 +494,7 @@ function decode(s) { /* ]]> */ -
+ invokeEvent('OnDocFormPrerender', array( From 98e68cbab53dd6523bb65243a9a654263cd8423d Mon Sep 17 00:00:00 2001 From: tonatos Date: Mon, 25 Aug 2014 18:09:58 +0600 Subject: [PATCH 2/2] Change publishedon, set value from current time to pub_date --- manager/includes/document.parser.class.inc.php | 2 +- manager/processors/save_content.processor.php | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index e095a859c3..be2256059e 100755 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -708,7 +708,7 @@ function checkPublishStatus() { $this->db->update( array( 'published' => 1, - 'publishedon' => $timeNow, + 'publishedon' => 'pub_date', ), $this->getFullTableName('site_content'), "pub_date <= {$timeNow} AND pub_date!=0 AND published=0"); // now, check for documents that need un-publishing diff --git a/manager/processors/save_content.processor.php b/manager/processors/save_content.processor.php index e829591270..8a9e5d2fec 100644 --- a/manager/processors/save_content.processor.php +++ b/manager/processors/save_content.processor.php @@ -312,6 +312,10 @@ $publishedon = ($published ? $currentdate : 0); $publishedby = ($published ? $modx->getLoginUserID() : 0); + if ((!empty($pub_date))&&($published)){ + $publishedon=$pub_date; + } + $dbInsert = array ( "introtext" => $introtext , @@ -485,8 +489,10 @@ if (!$was_published && $published) { $publishedon = $currentdate; $publishedby = $modx->getLoginUserID(); - } - elseif ($was_published && !$published) { + }elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) { + $publishedon = $pub_date; + $publishedby = $modx->getLoginUserID(); + }elseif ($was_published && !$published) { $publishedon = 0; $publishedby = 0; } else {