News items use new pubupdatedt instead of editeddt

This commit is contained in:
2017-10-08 09:30:26 +02:00
parent 3f78a6bc32
commit 8fc1c482f1
2 changed files with 5 additions and 5 deletions

View File

@@ -10,7 +10,7 @@ class NewsController extends Controller
private static $CALENDAR_CATEGORY = 42;
private static $BASE_SQL = <<<QUERY
SELECT `news`.`id`, `content`.`title`, `content`.`content`, `news`.`podcast` AS `podcast_id`, `news`.`video`, `news`.`keywords`, `news`.`titlewithdate`,
`news`.`creationdt` AS `published`, `content`.`creator`, `content`.`editingdt` AS `edited`, `content`.`editor`,
`news`.`creationdt` AS `published`, `content`.`creator`, `news`.`pubupdatedt` AS `edited`,
`news`.`startdt` AS `starts`, `news`.`enddt` AS `ends`,
`content`.`showsource` AS `showsource`, `sources`.`title` AS `source`, `sources`.`url` AS `source_url`,
`themes`.`title` AS `theme`, `themes`.`thumbnail` AS `theme_thumbnail`, `regions`.`title` AS `region`, `regions`.`slug` as `region_slug`

View File

@@ -29,10 +29,10 @@ class NewsItem extends Model {
parent::ConvertToDateTime($this->published);
parent::ConvertToDateTime($this->edited);
if($this->edited && ($this->edited->getTimestamp() - $this->published->getTimestamp() < 1800 /* == 30 minutes */)) {
// If last edit was within grace period, consider it unedited (note: currently RES always saves edited == published on creation)
$this->edited = null;
}
//if($this->edited && ($this->edited->getTimestamp() - $this->published->getTimestamp() < 1800 /* == 30 minutes */)) {
// // If last edit was within grace period, consider it unedited (note: currently RES always saves edited == published on creation)
// $this->edited = null;
//}
$this->source = null;
if(isset($data->source))