jenkins-bot has submitted this change and it was merged.

Change subject: Bug: action=purge wasnt purging history lists
......................................................................


Bug: action=purge wasnt purging history lists

Change-Id: I5865ebeacf5a16f09b2dccb9b0dd0432bec27067
---
M includes/Actions/PurgeAction.php
1 file changed, 26 insertions(+), 2 deletions(-)

Approvals:
  Matthias Mullie: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Actions/PurgeAction.php b/includes/Actions/PurgeAction.php
index ac300ef..ac4899d 100644
--- a/includes/Actions/PurgeAction.php
+++ b/includes/Actions/PurgeAction.php
@@ -86,19 +86,43 @@
                        array( 'pager-limit' => 499 )
                );
 
-               $this->fetchTopics( $pager->getPage()->getResults() );
+               $results = array();
+               foreach ( $pager->getPage()->getResults() as $entry ) {
+                       $results[] = $entry->getId();
+               }
+               $this->fetchTopics( $results );
+
+               // purge the board history
+               $storage->find(
+                       'BoardHistoryEntry',
+                       array( 'topic_list_id' => $workflow->getId() ),
+                       array( 'sort' => 'rev_id', 'order' => 'DESC', 'limit' 
=> 499 )
+               );
        }
+
 
        /**
         * Load the requested topics.  Does not return anything, the goal
         * here is to populate $this->hashBag.
         *
-        * @param UUID[]|TopicListEntry[] $results
+        * @param UUID[] $results
         */
        protected function fetchTopics( array $results ) {
+               // purge the revisions that make up the topic
                /** @var TopicListQuery $query */
                $query = Container::get( 'query.topiclist' );
                $query->getResults( $results );
+
+               // Purge the history
+               $queries = array();
+               foreach ( $results as $id ) {
+                       $queries[] = array( 'topic_root_id' => $id );
+               }
+               Container::get( 'storage' )->findMulti(
+                       'TopicHistoryEntry',
+                       $queries,
+                       array( 'sort' => 'rev_id', 'order' => 'DESC', 'limit' 
=> 499 )
+               );
        }
 
        /**

-- 
To view, visit https://gerrit.wikimedia.org/r/174900
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I5865ebeacf5a16f09b2dccb9b0dd0432bec27067
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <[email protected]>
Gerrit-Reviewer: Matthias Mullie <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to