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:
authormattab <matthieu.aubry@gmail.com>2014-05-09 09:27:44 +0400
committermattab <matthieu.aubry@gmail.com>2014-05-09 09:27:44 +0400
commitaf629ebd57e461ca6642508dd8e01437ec1f619a (patch)
treeda5a2754c22e7e91b0d7d7e2e53e5be813949664
parentccf13b8caf89e77d2885bb874c4f7691ade5fd6f (diff)
Fixes #5121 add New config setting to disable segment auto complete
-rw-r--r--config/global.ini.php4
-rw-r--r--plugins/API/API.php3
2 files changed, 7 insertions, 0 deletions
diff --git a/config/global.ini.php b/config/global.ini.php
index 53e6f758cf..c8eb245981 100644
--- a/config/global.ini.php
+++ b/config/global.ini.php
@@ -154,6 +154,10 @@ browser_archiving_disabled_enforce = 0
; this will only affect custom segments added or modified after this setting is changed.
enable_create_realtime_segments = 1
+; Whether to enable the "Suggest values for segment" in the Segment Editor panel.
+; Set this to 0 in case your Piwik database is very big, and suggested values may not appear in time
+enable_segment_suggested_values = 1
+
; this action name is used when the URL ends with a slash /
; it is useful to have an actual string to write in the UI
action_default_name = index
diff --git a/plugins/API/API.php b/plugins/API/API.php
index c0da00ced5..bb2d4af630 100644
--- a/plugins/API/API.php
+++ b/plugins/API/API.php
@@ -570,6 +570,9 @@ class API extends \Piwik\Plugin\API
*/
public function getSuggestedValuesForSegment($segmentName, $idSite)
{
+ if(empty(Config::getInstance()->General['enable_segment_suggested_values'])) {
+ return array();
+ }
Piwik::checkUserHasViewAccess($idSite);
$maxSuggestionsToReturn = 30;