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:
Diffstat (limited to 'plugins/DevicesDetection/Columns/BrowserName.php')
-rw-r--r--plugins/DevicesDetection/Columns/BrowserName.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/DevicesDetection/Columns/BrowserName.php b/plugins/DevicesDetection/Columns/BrowserName.php
index fa997d6f84..6e2f2ae49b 100644
--- a/plugins/DevicesDetection/Columns/BrowserName.php
+++ b/plugins/DevicesDetection/Columns/BrowserName.php
@@ -38,6 +38,7 @@ class BrowserName extends Base
$segment->setSegment('browserName');
$segment->setName('DevicesDetection_ColumnBrowser');
$segment->setAcceptedValues('FireFox, Internet Explorer, Chrome, Safari, Opera etc.');
+ $segment->setNeedsMostFrequentValues(false);
$segment->setSqlFilterValue(function ($val) {
$browsers = Browser::getAvailableBrowsers();
$browsers = array_map(function($val) {
@@ -51,8 +52,9 @@ class BrowserName extends Base
return $result;
});
- $segment->setSuggestedValuesCallback(function ($idSite, $maxValuesToReturn) {
- return array_values(Browser::getAvailableBrowsers() + ['Unknown']);
+ $segment->setSuggestedValuesCallback(function ($idSite, $maxValuesToReturn, $table) {
+ $browserList = Browser::getAvailableBrowsers();
+ return $this->sortStaticListByUsage($browserList, $table, 'browserCode', $maxValuesToReturn);
});
$segmentsList->addSegment($dimensionSegmentFactory->createSegment($segment));
}