EBernhardson has uploaded a new change for review.
https://gerrit.wikimedia.org/r/115531
Change subject: Sort the combined header+topic revisions after merging
......................................................................
Sort the combined header+topic revisions after merging
Change-Id: I3851469b3b8995a0aebfcb9f7444c9975789ba5a
---
M includes/Data/BoardHistoryStorage.php
1 file changed, 7 insertions(+), 6 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow
refs/changes/31/115531/1
diff --git a/includes/Data/BoardHistoryStorage.php
b/includes/Data/BoardHistoryStorage.php
index b1cb703..828b7ba 100644
--- a/includes/Data/BoardHistoryStorage.php
+++ b/includes/Data/BoardHistoryStorage.php
@@ -28,12 +28,13 @@
if ( count( $queries ) > 1 ) {
throw new DataModelException( __METHOD__ . ' expects
only one value in $queries', 'process-data' );
}
- return RevisionStorage::mergeExternalContent(
- array(
- $this->findHeaderHistory( $queries, $options )
+
- $this->findTopicListHistory( $queries,
$options )
- )
- );
+ $merged = $this->findHeaderHistory( $queries, $options ) +
+ $this->findTopicListHistory( $queries, $options );
+ uasort( $merged, function( $a, $b ) {
+ // $b first causes newest items at the begining of the
list
+ return strcmp( $b['rev_id'], $a['rev_id'] );
+ } );
+ return RevisionStorage::mergeExternalContent( array( $merged )
);
}
function findHeaderHistory( array $queries, array $options = array() ) {
--
To view, visit https://gerrit.wikimedia.org/r/115531
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3851469b3b8995a0aebfcb9f7444c9975789ba5a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits