Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAltamashShaikh <altamash@innocraft.com>2021-11-09 06:02:53 +0300
committerGitHub <noreply@github.com>2021-11-09 06:02:53 +0300
commit911ad6179b360cc02ebb5b0489041535b8bb7514 (patch)
tree96ef03b8cfd2537729c1f68d73c99fea3b0cc386 /plugins/Live
parent4fe950ae94b0fe3bd13f928544ff876275fe6733 (diff)
Changes to keep sorting order consistent across all PHP versions for Live.getLastVisitsDetails API (#18235)
* Changes to keep sorting order consistent across all php versions, #18234 * Started comparing index instead of returning -1 for visiotor sort, #18234
Diffstat (limited to 'plugins/Live')
-rw-r--r--plugins/Live/Visitor.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/Live/Visitor.php b/plugins/Live/Visitor.php
index 9267b80d73..388be77727 100644
--- a/plugins/Live/Visitor.php
+++ b/plugins/Live/Visitor.php
@@ -297,7 +297,7 @@ class Visitor implements VisitorInterface
private static function sortActionDetails($actions)
{
- usort($actions, function ($a, $b) {
+ usort($actions, function ($a, $b) use ($actions) {
$fields = array('serverTimePretty', 'idlink_va', 'type', 'title', 'url', 'pageIdAction', 'goalId');
foreach ($fields as $field) {
$sort = VisitorLog::sortByActionsOnPageColumn($a, $b, $field);
@@ -306,7 +306,10 @@ class Visitor implements VisitorInterface
}
}
- return 0;
+ $indexA = array_search($a, $actions);
+ $indexB = array_search($b, $actions);
+
+ return $indexA > $indexB ? 1 : -1;
});
return $actions;