From 73c06026a39a8ba62f83f7082e744480bcc6b86e Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Wed, 31 Aug 2016 10:42:59 +1200 Subject: Apply default filter_limit to all API calls (#10009) * fix #8458 Apply default filter_limit to all API calls * return all results where needed instead of default filter limit of 100 * make sure to apply offset * fix unit tests * fix import logs test as they post the filter value --- plugins/Dashboard/angularjs/common/services/dashboards-model.js | 2 +- plugins/Dashboard/javascripts/dashboard.js | 3 ++- plugins/Dashboard/javascripts/dashboardObject.js | 3 ++- plugins/Dashboard/javascripts/widgetMenu.js | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) (limited to 'plugins/Dashboard') diff --git a/plugins/Dashboard/angularjs/common/services/dashboards-model.js b/plugins/Dashboard/angularjs/common/services/dashboards-model.js index 8cdfbec772..df2e147fa1 100644 --- a/plugins/Dashboard/angularjs/common/services/dashboards-model.js +++ b/plugins/Dashboard/angularjs/common/services/dashboards-model.js @@ -55,7 +55,7 @@ function getAllDashboards() { if (!dashboardsPromise) { - dashboardsPromise = piwikApi.fetch({method: 'Dashboard.getDashboards'}).then(function (response) { + dashboardsPromise = piwikApi.fetch({method: 'Dashboard.getDashboards', filter_limit: '-1'}).then(function (response) { if (response) { model.dashboards = response; } diff --git a/plugins/Dashboard/javascripts/dashboard.js b/plugins/Dashboard/javascripts/dashboard.js index 48c3430824..27ef28dfa0 100644 --- a/plugins/Dashboard/javascripts/dashboard.js +++ b/plugins/Dashboard/javascripts/dashboard.js @@ -99,7 +99,8 @@ function copyDashboardToUser() { ajaxRequest.addParams({ module: 'API', method: 'UsersManager.getUsers', - format: 'json' + format: 'json', + filter_limit: '-1' }, 'get'); ajaxRequest.setCallback( function (availableUsers) { diff --git a/plugins/Dashboard/javascripts/dashboardObject.js b/plugins/Dashboard/javascripts/dashboardObject.js index 13862ecd5b..4165bfcaec 100644 --- a/plugins/Dashboard/javascripts/dashboardObject.js +++ b/plugins/Dashboard/javascripts/dashboardObject.js @@ -585,7 +585,8 @@ var ajaxRequest = new ajaxHelper(); ajaxRequest.addParams({ module: 'Dashboard', - action: 'getAllDashboards' + action: 'getAllDashboards', + filter_limit: '-1' }, 'get'); ajaxRequest.withTokenInUrl(); ajaxRequest.setCallback(success); diff --git a/plugins/Dashboard/javascripts/widgetMenu.js b/plugins/Dashboard/javascripts/widgetMenu.js index 100674ce00..d3d96569eb 100644 --- a/plugins/Dashboard/javascripts/widgetMenu.js +++ b/plugins/Dashboard/javascripts/widgetMenu.js @@ -69,6 +69,7 @@ widgetsHelper.getAvailableWidgets = function (callback) { ajaxRequest.addParams({ module: 'API', method: 'API.getWidgetMetadata', + filter_limit: '-1', format: 'JSON', deep: '1', idSite: piwik.idSite || broadcast.getValueFromUrl('idSite') -- cgit v1.2.3