Skip to content

Commit fc6eeb9

Browse files
authored
ParticipantReport loadReport() to check reportType before loading saved configuration (#7437)
- found by crawler running TimeChartDateBasedTest
1 parent 2ba6ea6 commit fc6eeb9

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

study/webapp/study/ParticipantReport.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -679,9 +679,15 @@ Ext4.define('LABKEY.ext4.ParticipantReport', {
679679
method : 'GET',
680680
params : {reportId : reportId},
681681
success : function(response) {
682+
var reportConfig = Ext4.decode(response.responseText).reportConfig;
683+
if (reportConfig.properties.reportType !== 'ReportService.ParticipantReport') {
684+
this.onFailure({ responseText: '{"exception": "The report specified is not a Participant Report and cannot be loaded."}' });
685+
return;
686+
}
687+
682688
this.reportName.setReadOnly(true);
683689
this.saveAsButton.setVisible(true);
684-
this.loadSavedConfig(Ext4.decode(response.responseText).reportConfig);
690+
this.loadSavedConfig(reportConfig);
685691
},
686692
failure : this.onFailure,
687693
scope : this
@@ -1136,7 +1142,7 @@ Ext4.define('LABKEY.ext4.ParticipantReport', {
11361142
msg = "There was a failure. If the problem persists please contact your administrator.";
11371143
}
11381144
this.unmask();
1139-
Ext4.Msg.alert('Failure', msg);
1145+
Ext4.Msg.show({ title: "Failure", msg, icon: Ext4.Msg.ERROR, buttons: Ext4.Msg.OK });
11401146
},
11411147

11421148
// get the grid fields in a form that the visualization getData api can understand

0 commit comments

Comments
 (0)