grav-plugin-events
grav-plugin-events copied to clipboard
No end date causes site crash
I have a site with dozens of events on it (shows for a musician) and most have no end date, only a start date. This site works perfectly fine on a live server but I downloaded it today to make some changes on my local server and the site crashed with error: "Undefined index: end". This was highlighted in eventsProcessor.php:
On one hand this makes sense, it's looking for an event end date and none of my events have that. On the other hand, I have no problems on my live server. Any ideas why?
Perhaps a check could be added to eventsProcessor.php to only add the end date to the event object if the end date exists. I tried this out and it works great:
if ( isset( $event['end'] ) ) {
$carbonEvent['end'] = Carbon::parse( $event['end'] );
}
Nice solution, works for me too.