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/Os.php')
-rw-r--r--plugins/DevicesDetection/Columns/Os.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/DevicesDetection/Columns/Os.php b/plugins/DevicesDetection/Columns/Os.php
index 80ef344194..4e5bf84418 100644
--- a/plugins/DevicesDetection/Columns/Os.php
+++ b/plugins/DevicesDetection/Columns/Os.php
@@ -40,6 +40,7 @@ class Os extends Base
$segment->setSegment('operatingSystemName');
$segment->setName('DevicesDetection_ColumnOperatingSystem');
$segment->setAcceptedValues('Windows, Linux, Mac, Android, iOS etc.');
+ $segment->setNeedsMostFrequentValues(false);
$segment->setSqlFilterValue(function ($val) {
$oss = OperatingSystem::getAvailableOperatingSystems();
$oss = array_map(function($val) {
@@ -53,8 +54,9 @@ class Os extends Base
return $result;
});
- $segment->setSuggestedValuesCallback(function ($idSite, $maxValuesToReturn) {
- return array_values(OperatingSystem::getAvailableOperatingSystems() + ['Unknown']);
+ $segment->setSuggestedValuesCallback(function ($idSite, $maxValuesToReturn, $table) {
+ return $this->sortStaticListByUsage(OperatingSystem::getAvailableOperatingSystems(), $table,
+ 'operatingSystemCode', $maxValuesToReturn);
});
$segmentsList->addSegment($dimensionSegmentFactory->createSegment($segment));
}