diff options
-rw-r--r-- | config/global.ini.php | 4 | ||||
-rw-r--r-- | plugins/API/API.php | 3 |
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; |