Browse Source

Adding a warning for missing registrationQuery value in crfSettings in crfData.js

Andrej Studen 1 year ago
parent
commit
cadb04a77f
1 changed files with 6 additions and 1 deletions
  1. 6 1
      web/crf/crfData.js

+ 6 - 1
web/crf/crfData.js

@@ -400,8 +400,13 @@ function(cb=null){
 
 crfData.setRegistration=
 function(cb=null){
-   let regQueryPars=variableList.parseVariables(this.setup.getSettings('registrationQuery'));
+   let regQuerySettings=this.setup.getSettings('registrationQuery');
+   let regQueryPars=variableList.parseVariables(regQuerySettings);
    let q=regQueryPars['query'];
+   if (!q){
+      this.print('Registration query not set, got ['+regQuerySettings+'] for settings, should have query=X format');
+      return;
+   }
    let queryArray=new Array();   
    let targetObject=this.getSnapshotObject();
    let filters=[];