From 936d3b89074c5efc227e6ec11c1988502d7ac99f Mon Sep 17 00:00:00 2001
From: diosmosis <benaka@piwik.pro>
Date: Thu, 10 Sep 2015 20:02:38 -0700
Subject: [PATCH] Do not display suggestedValuesCallback in API output if it is
 not a string.

---
 plugins/API/API.php | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/plugins/API/API.php b/plugins/API/API.php
index 72411c21be..ff6690fdf2 100644
--- a/plugins/API/API.php
+++ b/plugins/API/API.php
@@ -190,6 +190,12 @@ class API extends \Piwik\Plugin\API
                 unset($segment['sqlFilterValue']);
                 unset($segment['sqlSegment']);
             }
+
+            if (isset($segment['suggestedValuesCallback'])
+                && !is_string($segment['suggestedValuesCallback'])
+            ) {
+                unset($segment['suggestedValuesCallback']);
+            }
         }
 
         usort($segments, array($this, 'sortSegments'));
-- 
GitLab