Do not decrement wcf1_user.articles when deleting unpublished articles
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 5 Aug 2020 10:05:08 +0000 (12:05 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 5 Aug 2020 10:05:08 +0000 (12:05 +0200)
see b044815dd9b6509fc44219684d7076cd28a80aa6
see #3480

wcfsetup/install/files/lib/data/article/ArticleAction.class.php

index 595d598291d2adc656a63266cfbef3d456806669..5499048e3438f9310231827c4cea7c9ada6d0da7 100644 (file)
@@ -276,7 +276,9 @@ class ArticleAction extends AbstractDatabaseObjectAction {
                                $articleContentIDs[] = $articleContent->articleContentID;
                        }
                        
-                       $usersToArticles[$article->userID] = ($usersToArticles[$article->userID] ?? 0) - 1;
+                       if ($article->publicationStatus == Article::PUBLISHED) {
+                               $usersToArticles[$article->userID] = ($usersToArticles[$article->userID] ?? 0) - 1;
+                       }
                }
                
                // delete articles