From 7539c19cebcb9e7392c9c3aea8401957d4bd12e1 Mon Sep 17 00:00:00 2001 From: cnathe Date: Thu, 19 Feb 2026 10:03:15 -0600 Subject: [PATCH] ParticipantReport loadReport() to check reportType before loading saved configuration - found by crawler running TimeChartDateBasedTest --- study/webapp/study/ParticipantReport.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/study/webapp/study/ParticipantReport.js b/study/webapp/study/ParticipantReport.js index 71facc638f6..bb5ffbccf79 100644 --- a/study/webapp/study/ParticipantReport.js +++ b/study/webapp/study/ParticipantReport.js @@ -679,9 +679,15 @@ Ext4.define('LABKEY.ext4.ParticipantReport', { method : 'GET', params : {reportId : reportId}, success : function(response) { + var reportConfig = Ext4.decode(response.responseText).reportConfig; + if (reportConfig.properties.reportType !== 'ReportService.ParticipantReport') { + this.onFailure({ responseText: '{"exception": "The report specified is not a Participant Report and cannot be loaded."}' }); + return; + } + this.reportName.setReadOnly(true); this.saveAsButton.setVisible(true); - this.loadSavedConfig(Ext4.decode(response.responseText).reportConfig); + this.loadSavedConfig(reportConfig); }, failure : this.onFailure, scope : this @@ -1136,7 +1142,7 @@ Ext4.define('LABKEY.ext4.ParticipantReport', { msg = "There was a failure. If the problem persists please contact your administrator."; } this.unmask(); - Ext4.Msg.alert('Failure', msg); + Ext4.Msg.show({ title: "Failure", msg, icon: Ext4.Msg.ERROR, buttons: Ext4.Msg.OK }); }, // get the grid fields in a form that the visualization getData api can understand