Skip to content
This repository was archived by the owner on Mar 8, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion manager/actions/mutate_content.dynamic.php
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ function decode(s) {
/* ]]> */
</script>

<form name="mutate" id="mutate" class="content" method="post" enctype="multipart/form-data" action="index.php">
<form name="mutate" id="mutate" class="content" method="post" enctype="multipart/form-data" action="index.php" onsubmit="documentDirty=false;">
<?php
// invoke OnDocFormPrerender event
$evtOut = $modx->invokeEvent('OnDocFormPrerender', array(
Expand Down
2 changes: 1 addition & 1 deletion manager/includes/document.parser.class.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 8 additions & 2 deletions manager/processors/save_content.processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ,
Expand Down Expand Up @@ -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 {
Expand Down