From 892687f0ebb927405f59eea4e9d305fe1262ca5d Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Tue, 20 Sep 2016 17:43:41 +0200 Subject: [PATCH] Use ArticleAction instead ArticleEditor for article publication --- .../cronjob/ArticlePublicationCronjob.class.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/wcfsetup/install/files/lib/system/cronjob/ArticlePublicationCronjob.class.php b/wcfsetup/install/files/lib/system/cronjob/ArticlePublicationCronjob.class.php index 38bc0889b9..4d70c0bbf5 100644 --- a/wcfsetup/install/files/lib/system/cronjob/ArticlePublicationCronjob.class.php +++ b/wcfsetup/install/files/lib/system/cronjob/ArticlePublicationCronjob.class.php @@ -1,6 +1,7 @@ decoratorClassName = ArticleEditor::class; $articleList->readObjects(); - foreach ($articleList as $editor) { - /** @var ArticleEditor $editor */ - $editor->update([ - 'time' => $editor->publicationDate, - 'publicationStatus' => Article::PUBLISHED, - 'publicationDate' => 0 + foreach ($articleList as $article) { + $action = new ArticleAction(array($article), 'update', [ + 'data' => [ + 'time' => $article->publicationDate, + 'publicationStatus' => Article::PUBLISHED, + 'publicationDate' => 0 + ] ]); + $action->executeAction(); } } } -- 2.20.1