Skip to content
7 changes: 4 additions & 3 deletions core/src/Revolution/Processors/Resource/Get.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* This file is part of MODX Revolution.
*
Expand Down Expand Up @@ -30,8 +31,8 @@ public function process()
{
$resourceArray = $this->object->toArray();
$resourceArray['canpublish'] = $this->modx->hasPermission('publish_document');
if (!$this->getProperty('skipFormatDates') ||
($this->getProperty('skipFormatDates') && $this->getProperty('skipFormatDates') == 'false')) {
$skipFormatDates = $this->modx->paramValueIsTrue($this->getProperties(), 'skipFormatDates');
if (!$skipFormatDates) {
$this->formatDates($resourceArray);
}
return $this->success('', $resourceArray);
Expand All @@ -51,7 +52,7 @@ public function formatDates(array &$resourceArray)
} else {
$resourceArray['unpub_date'] = '';
}
if (!empty($resourceArray) && $resourceArray['publishedon'] != '0000-00-00 00:00:00') {
if (!empty($resourceArray['publishedon']) && $resourceArray['publishedon'] != '0000-00-00 00:00:00') {
$resourceArray['publishedon'] = date($format, strtotime($resourceArray['publishedon']));
} else {
$resourceArray['publishedon'] = '';
Expand Down
Loading