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

Change subject: Bug: Comparing array against maybe array
......................................................................


Bug: Comparing array against maybe array

The provided sort value can either be an array or a single string
if there is only one field to sort by.  This is used, for example,
in BoardHistoryQuery. There shouldn't be any directly visible changes
due to this patch, board history will start using the index
but the user experience should be the same as we were falling back
to direct db query previously where this is incorrect.

Change-Id: I3b1ec3d29035f780e77a6ae42b01492f948308aa
---
M includes/Data/Index/TopKIndex.php
1 file changed, 2 insertions(+), 1 deletion(-)

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



diff --git a/includes/Data/Index/TopKIndex.php 
b/includes/Data/Index/TopKIndex.php
index a7c4d14..b79e93f 100644
--- a/includes/Data/Index/TopKIndex.php
+++ b/includes/Data/Index/TopKIndex.php
@@ -4,6 +4,7 @@
 
 use BagOStuff;
 use Flow\Data\BufferedCache;
+use Flow\Data\ObjectManager;
 use Flow\Data\ObjectStorage;
 use Flow\Data\Compactor\ShallowCompactor;
 use Flow\Data\Utils\SortArrayByKeys;
@@ -47,7 +48,7 @@
                        return false;
                }
                if ( isset( $options['sort'], $options['order'] ) ) {
-                       return $options['sort'] === $this->options['sort']
+                       return ObjectManager::makeArray( $options['sort'] ) === 
$this->options['sort']
                                && strtoupper( $options['order'] ) === 
$this->options['order'];
                }
                return true;

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

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

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

Reply via email to