From: Andrew Otto Date: Tue, 12 Jul 2016 18:42:33 +0000 (-0400) Subject: Pass $archivedRevisionCount to the ArticleDeleteComplete hook X-Git-Tag: 1.31.0-rc.0~6176^2 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=b10bb9c5f5793e6959e83e30f1bfc5ccc81be29d;p=lhc%2Fweb%2Fwiklou.git Pass $archivedRevisionCount to the ArticleDeleteComplete hook Bug: T134502 Change-Id: I1df89beeadbec2a3592e51fbb525ed6db2424619 --- diff --git a/docs/hooks.txt b/docs/hooks.txt index 57240c98f9..c53490a112 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -608,6 +608,7 @@ $reason: the reason the article was deleted $id: id of the article that was deleted $content: the Content of the deleted page $logEntry: the ManualLogEntry used to record the deletion +$archivedRevisionCount: the number of revisions archived during the deletion 'ArticleEditUpdateNewTalk': Before updating user_newtalk when a user talk page was changed. diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index 26028b1f2a..a63a784793 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -2927,6 +2927,8 @@ class WikiPage implements Page, IDBAccessObject { ], __METHOD__ ); + // Save this so we can pass it to the ArticleDeleteComplete hook. + $archivedRevisionCount = $dbw->affectedRows(); // Now that it's safely backed up, delete it $dbw->delete( 'page', [ 'page_id' => $id ], __METHOD__ ); @@ -2957,7 +2959,7 @@ class WikiPage implements Page, IDBAccessObject { $this->doDeleteUpdates( $id, $content ); Hooks::run( 'ArticleDeleteComplete', - [ &$this, &$user, $reason, $id, $content, $logEntry ] ); + [ &$this, &$user, $reason, $id, $content, $logEntry, $archivedRevisionCount ] ); $status->value = $logid; // Show log excerpt on 404 pages rather than just a link