This commit is contained in:
Nathan Coad
2018-06-17 09:17:37 +10:00
parent fb59029be1
commit 138f608a26

View File

@@ -43,6 +43,13 @@ function booking_studygroups_csv_report($group_id) {
array(':sid' => $group_id));
$session_members = $session_members_query->fetchAll();
// Check if we had no data added, that means there were no people in this study group
if (! $session_members) {
drupal_set_message("Error: Study group $group_id has no members assigned.", 'error', FALSE);
drupal_goto('admin/booking/studygroups');
return "";
}
//generate the row data
foreach ($session_members as $member) {
if (! isset($data[$member->booking_session_id])) {
@@ -71,6 +78,7 @@ function booking_studygroups_csv_report($group_id) {
// Check if we had no data added, that means there were no people in this study group
if (empty($data)) {
drupal_set_message("Error: Study group $group_id has no people assigned.", 'error', FALSE);
drupal_goto('admin/booking/studygroups');
return "";
}