Skip to content

Commit

Permalink
[BUGFIX] Use today as publishing date for new blog entries (#59)
Browse files Browse the repository at this point in the history
Fixes: #58
Releases: master, 9.1, 9.0, 8.7
  • Loading branch information
benjaminkott committed Apr 29, 2019
1 parent ee1f657 commit 2fea8d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Classes/Hooks/DataHandlerHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ public function processDatamap_afterDatabaseOperations($status, $table, $id, arr
->execute()
->fetch();
if (!empty($record)) {
$timestamp = $record['publish_date'] ?? time();
$timestamp = (int) (!empty($record['publish_date']) ? $record['publish_date'] : time());
$queryBuilder
->update($table)
->set('publish_date', $record['publish_date'])
->set('publish_date', $timestamp)
->set('crdate_month', date('n', (int)$timestamp))
->set('crdate_year', date('Y', (int)$timestamp))
->where($queryBuilder->expr()->eq('uid', (int)$id))
Expand Down

0 comments on commit 2fea8d7

Please sign in to comment.