ArielGlenn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/362177 )

Change subject: force topics to be exported by UUID order
......................................................................

force topics to be exported by UUID order

Bug: T164262
Change-Id: I3035314df21b48df47a120a18c818615a58546a0
---
M includes/Dump/Exporter.php
M includes/Search/Iterators/TopicIterator.php
2 files changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/77/362177/1

diff --git a/includes/Dump/Exporter.php b/includes/Dump/Exporter.php
index 0f2bfd0..822d046 100644
--- a/includes/Dump/Exporter.php
+++ b/includes/Dump/Exporter.php
@@ -174,6 +174,7 @@
 
                                $headerIterator = Container::get( 
'search.index.iterators.header' );
                                $topicIterator = Container::get( 
'search.index.iterators.topic' );
+                               $topicIterator->orderByUUID = true;
                                /** @var AbstractIterator $iterator */
                                foreach ( [ $headerIterator, $topicIterator ] 
as $iterator ) {
                                        $iterator->setPage( 
$row->workflow_page_id );
diff --git a/includes/Search/Iterators/TopicIterator.php 
b/includes/Search/Iterators/TopicIterator.php
index f15888b..22cc130 100644
--- a/includes/Search/Iterators/TopicIterator.php
+++ b/includes/Search/Iterators/TopicIterator.php
@@ -26,6 +26,7 @@
        public function __construct( DbFactory $dbFactory, RootPostLoader 
$rootPostLoader ) {
                parent::__construct( $dbFactory );
                $this->rootPostLoader = $rootPostLoader;
+               $this->orderByUUID = false;
        }
 
        /**
@@ -84,6 +85,11 @@
         * {@inheritDoc}
         */
        protected function query() {
+               if ( $this->orderByUUID ) {
+                       $order = 'workflow_id ASC';
+               } else {
+                       $order = 'workflow_last_update_timestamp ASC';
+               }
                return $this->dbr->select(
                        [ 'flow_workflow' ],
                        // for root post (topic title), workflow_id is the same 
as its rev_type_id
@@ -93,7 +99,7 @@
                        ] + $this->conditions,
                        __METHOD__,
                        [
-                               'ORDER BY' => 'workflow_last_update_timestamp 
ASC',
+                               'ORDER BY' => $order,
                        ]
                );
        }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3035314df21b48df47a120a18c818615a58546a0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: ArielGlenn <[email protected]>

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

Reply via email to