From cca44a9bd081fe0936f37c505deb73849534ee15 Mon Sep 17 00:00:00 2001 From: Chris Burgess Date: Sat, 20 May 2017 09:16:01 +1200 Subject: [PATCH] Pass title of action(s) to refresh(), to make errors more informative. CRM-20602 --- ang/crmStatusPage/StatusPageCtrl.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ang/crmStatusPage/StatusPageCtrl.js b/ang/crmStatusPage/StatusPageCtrl.js index c308d14e2e..c718910ac8 100644 --- a/ang/crmStatusPage/StatusPageCtrl.js +++ b/ang/crmStatusPage/StatusPageCtrl.js @@ -8,7 +8,7 @@ $scope.statuses = statusData.values; // Refresh the list. Optionally execute api calls first. - function refresh(apiCalls) { + function refresh(apiCalls, title) { apiCalls = (apiCalls || []).concat([['System', 'check', {sequential: 1}]]); $('#crm-status-list').block(); crmApi(apiCalls, true) @@ -16,13 +16,13 @@ $scope.statuses = results[results.length - 1].values; results.forEach(function(result) { if (result.is_error) { - var error_message = ts('result.error_message'); + var error_message = ts(result.error_message); if (typeof(result.debug_information) !== 'undefined') { error_message += '
' + '' + ts('Debug information') + ':
' + result.debug_information + '
'; } - CRM.alert(error_message, ts('API error'), 'error'); + CRM.alert(error_message, ts('Operation failed: ' + title), 'error'); } }); $('#crm-status-list').unblock(); @@ -37,7 +37,7 @@ ignore_severity: visible ? 0 : status.severity, hush_until: until }] - ]); + ], 'Set preference'); }; $scope.countVisible = function(visibility) { @@ -54,7 +54,7 @@ break; case 'api3': - refresh([action.params]); + refresh([action.params], action.title); break; } } -- 2.25.1