Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Fix JS errors on reporting page

Oliver Günther6c42862c7064
diff --git a/frontend/src/app/features/reporting/reporting-page/functionality/reporting_engine/controls.js b/frontend/src/app/features/reporting/reporting-page/functionality/reporting_engine/controls.js
index 9da62f1bcd0..56f395b8eef 100644
--- a/frontend/src/app/features/reporting/reporting-page/functionality/reporting_engine/controls.js
+++ b/frontend/src/app/features/reporting/reporting-page/functionality/reporting_engine/controls.js
@@ -54,9 +54,7 @@ Reporting.Controls = function($){
};
var send_settings_data = function (targetUrl, callback, failureCallback) {
- if (!failureCallback) {
- failureCallback = default_failure_callback;
- }
+ var errorCallback = failureCallback || default_failure_callback()
Reporting.clearFlash();
$.ajax({
@@ -66,7 +64,7 @@ Reporting.Controls = function($){
beforeSend: function () {
$('#ajax-indicator').show();
},
- error: failureCallback,
+ error: errorCallback,
success: callback
});
};
@@ -94,7 +92,7 @@ Reporting.Controls = function($){
if (element === null) {
return;
}
- failureCallback = function (response) {
+ var failureCallback = function (response) {
$('#result-table').html("");
default_failure_callback(response);
diff --git a/frontend/src/app/features/reporting/reporting-page/functionality/reporting_engine/filters.js b/frontend/src/app/features/reporting/reporting-page/functionality/reporting_engine/filters.js
index 86765960091..a189d6ad0e7 100644
--- a/frontend/src/app/features/reporting/reporting-page/functionality/reporting_engine/filters.js
+++ b/frontend/src/app/features/reporting/reporting-page/functionality/reporting_engine/filters.js
@@ -338,7 +338,7 @@ Reporting.Filters = function($){
$(".advanced-filters--filter-value .filter-value").each(function () {
var select = $(this);
- select_value = select.val();
+ var select_value = select.val();
select.attr('multiple', select_value && select_value.length > 1);