summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2018-08-28 18:28:09 +0200
committerGitHub <noreply@github.com>2018-08-28 18:28:09 +0200
commit1090d5e889827056e445b5c1fe0fa7f8e395d8ec (patch)
tree5984b7282026af8e63f9c0835d14e4898206447f
parentd93ace2eaef8d7077fe93f27a1528f936ffe1172 (diff)
Update shifts_controller.php
fix problem when missing needed angeltype entry
-rw-r--r--includes/controller/shifts_controller.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/includes/controller/shifts_controller.php b/includes/controller/shifts_controller.php
index b8ed0180..7cac5b4a 100644
--- a/includes/controller/shifts_controller.php
+++ b/includes/controller/shifts_controller.php
@@ -277,6 +277,10 @@ function shift_controller()
$shift_signup_state = new ShiftSignupState(ShiftSignupState::OCCUPIED, 0);
foreach ($angeltypes as &$angeltype) {
$needed_angeltype = NeededAngeltype_by_Shift_and_Angeltype($shift, $angeltype);
+ if(empty($needed_angeltype)) {
+ continue;
+ }
+
$shift_entries = ShiftEntries_by_shift_and_angeltype($shift['SID'], $angeltype['id']);
$angeltype_signup_state = Shift_signup_allowed(
@@ -288,11 +292,7 @@ function shift_controller()
$needed_angeltype,
$shift_entries
);
- if (empty($shift_signup_state)) {
- $shift_signup_state = $angeltype_signup_state;
- } else {
- $shift_signup_state->combineWith($angeltype_signup_state);
- }
+ $shift_signup_state->combineWith($angeltype_signup_state);
$angeltype['shift_signup_state'] = $angeltype_signup_state;
}