Removed check in program that crashed the site and seems to be unneccesary(?)

This commit is contained in:
2018-01-12 09:45:08 +01:00
parent 5cb66ec18c
commit c8f7887761

View File

@@ -106,7 +106,9 @@ QUERY;
}
// Only use this item if it is valid
if(($item[2]->startdate == null || $item[2]->startdate <= $activeProgramStart) && ($item[2]->enddate == null || $item[2]->enddate > $activeProgramStart))
// MS 2018-01-12: Don't know why I originally had this, the list should only contain valid items.
// This crashed the site once because it skipped a program that should have been in the list but generated 'program not active at priorty' message later on.
// if(($item[2]->startdate == null || $item[2]->startdate <= $activeProgramStart) && ($item[2]->enddate == null || $item[2]->enddate > $activeProgramStart))
{
if($DEBUG) print "<b>{$item[1]->format('d-m-Y H:i')}: {$item[2]->name} {$item[2]->suffix} " . ($item[0] == $START ? "begint" : "eindigt") . "</b><br/>";
@@ -161,10 +163,11 @@ QUERY;
} else {
return response()->abort(500, "Invalid item type: expected START ($START) or END ($END), but got {$item[0]}.");
}
} else if($DEBUG) {
print "<i>Skipped {$item[2]->name} {$item[2]->suffix} on {$item[1]->format('d-m-Y H:i')} "
. " because startdate is " . ($item[2]->startdate == null ? "[null]" : $item[2]->startdate->format('d-m-Y H:i'))
. " and end date is " . ($item[2]->enddate == null ? "[null]" : $item[2]->enddate->format('d-m-Y H:i')) . "</i><br/>";
//} else if($DEBUG) {
// print "<i>Skipped {$item[2]->name} {$item[2]->suffix} on {$item[1]->format('d-m-Y H:i')} <br/>"
// . " &nbsp;&nbsp; because startdate is " . ($item[2]->startdate == null ? "[null]" : $item[2]->startdate->format('d-m-Y H:i')) . " <br/>"
// . " &nbsp;&nbsp; and end date is " . ($item[2]->enddate == null ? "[null]" : $item[2]->enddate->format('d-m-Y H:i')) . " <br/>"
// . " &nbsp;&nbsp; Active program " . ($activeProgram ? $activeProgram->name : '[null]') . " starts at " . $activeProgramStart->format('c') . "</i><br/>";
}
// The item will recur in a week