Skip to content
This repository has been archived by the owner on Apr 2, 2019. It is now read-only.

No end date causes site crash #49

Open
diegovogel opened this issue Jan 29, 2018 · 1 comment
Open

No end date causes site crash #49

diegovogel opened this issue Jan 29, 2018 · 1 comment

Comments

@diegovogel
Copy link

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:
image

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'] );
}
@webfed
Copy link

webfed commented Oct 27, 2018

Nice solution, works for me too.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants