@@ -375,7 +375,8 @@ function view_risk_details($id, $submission_date, $submitted_by, $subject, $refe
375375 {
376376 // Include the extra
377377 require_once (realpath (__DIR__ . '/../extras/customization/index.php ' ));
378- if (!$ template_group_id ) {
378+ $ template_group = get_custom_template_group_by_id ($ template_group_id );
379+ if (!$ template_group_id || !$ template_group ) {
379380 $ group = get_default_template_group ("risk " );
380381 $ template_group_id = $ group ["id " ];
381382 }
@@ -750,7 +751,8 @@ function edit_risk_details($id, $submission_date,$submitted_by, $subject, $refer
750751 {
751752 // Include the extra
752753 require_once (realpath (__DIR__ . '/../extras/customization/index.php ' ));
753- if (!$ template_group_id ){
754+ $ template_group = get_custom_template_group_by_id ($ template_group_id );
755+ if (!$ template_group_id || !$ template_group ) {
754756 $ group = get_default_template_group ("risk " );
755757 $ template_group_id = $ group ["id " ];
756758 }
@@ -866,7 +868,8 @@ function view_mitigation_details($risk_id, $mitigation_id, $mitigation_date, $pl
866868 {
867869 // Include the extra
868870 require_once (realpath (__DIR__ . '/../extras/customization/index.php ' ));
869- if (!$ template_group_id ){
871+ $ template_group = get_custom_template_group_by_id ($ template_group_id );
872+ if (!$ template_group_id || !$ template_group ) {
870873 $ group = get_default_template_group ("risk " );
871874 $ template_group_id = $ group ["id " ];
872875 }
@@ -1153,7 +1156,8 @@ function edit_mitigation_details($risk_id, $mitigation_id, $mitigation_date, $pl
11531156 {
11541157 // Include the extra
11551158 require_once (realpath (__DIR__ . '/../extras/customization/index.php ' ));
1156- if (!$ template_group_id ){
1159+ $ template_group = get_custom_template_group_by_id ($ template_group_id );
1160+ if (!$ template_group_id || !$ template_group ) {
11571161 $ group = get_default_template_group ("risk " );
11581162 $ template_group_id = $ group ["id " ];
11591163 }
@@ -1466,7 +1470,8 @@ function view_review_details($id, $review_id, $review_date, $reviewer, $review,
14661470 {
14671471 // Include the extra
14681472 require_once (realpath (__DIR__ . '/../extras/customization/index.php ' ));
1469- if (!$ template_group_id ){
1473+ $ template_group = get_custom_template_group_by_id ($ template_group_id );
1474+ if (!$ template_group_id || !$ template_group ) {
14701475 $ group = get_default_template_group ("risk " );
14711476 $ template_group_id = $ group ["id " ];
14721477 }
@@ -1621,7 +1626,8 @@ function edit_review_submission($id, $review_id, $review, $next_step, $next_revi
16211626 {
16221627 // Include the extra
16231628 require_once (realpath (__DIR__ . '/../extras/customization/index.php ' ));
1624- if (!$ template_group_id ){
1629+ $ template_group = get_custom_template_group_by_id ($ template_group_id );
1630+ if (!$ template_group_id || !$ template_group ) {
16251631 $ group = get_default_template_group ("risk " );
16261632 $ template_group_id = $ group ["id " ];
16271633 }
0 commit comments