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

View File

@@ -42,6 +42,13 @@ function booking_studygroups_csv_report($group_id) {
WHERE m.booking_studygroup_id = :sid ORDER BY m.booking_session_id, m.booking_studygroup_role DESC, p.booking_lastname",
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) {
@@ -70,7 +77,8 @@ 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_set_message("Error: Study group $group_id has no people assigned.", 'error', FALSE);
drupal_goto('admin/booking/studygroups');
return "";
}