handle empty variety sessions

This commit is contained in:
Nathan Coad
2018-07-03 23:19:32 +10:00
parent cc8c326753
commit ede732c310

View File

@@ -552,6 +552,13 @@ function booking_varietysessions_csv_report($timeslot_id) {
WHERE p.booking_eventid = :eid ORDER BY r.rid",
array(':eid' => $event->eid));
$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: Variety Session timeslot $timeslot_id has no members assigned.", 'error', FALSE);
drupal_goto('admin/booking/variety');
return "";
}
//watchdog('booking_debug', 'booking_varietysessions_csv_report session members: <pre>@info</pre>', array('@info' => print_r( $session_members, true)));