Jump to content

Events - Error: Call to a member function format() on null


Go to solution Solved by Marc Stridgen,

Recommended Posts

Error: Call to a member function format() on null (0)
#0 /var/www/html/ips-themes/system/Patterns/ActiveRecord.php(335): IPS\calendar\_Event->get__happening()
#1 /var/www/html/ips-themes/system/Theme/Theme.php(4620) : eval()'d code(36): IPS\Patterns\_ActiveRecord->__get()
#2 /var/www/html/ips-themes/system/Theme/Dev/Template.php(171): IPS\Theme\theme_calendar_front_view_coverPhotoOverlay()
#3 /var/www/html/ips-themes/applications/calendar/sources/Event/Event.php(2309): IPS\Theme\Dev\_Template->__call()
#4 /var/www/html/ips-themes/applications/calendar/modules/front/calendar/event.php(166): IPS\calendar\_Event->coverPhoto()
#5 /var/www/html/ips-themes/system/Dispatcher/Controller.php(118): IPS\calendar\modules\front\calendar\_event->manage()
#6 /var/www/html/ips-themes/system/Content/Controller.php(50): IPS\Dispatcher\_Controller->execute()
#7 /var/www/html/ips-themes/applications/calendar/modules/front/calendar/event.php(64): IPS\Content\_Controller->execute()
#8 /var/www/html/ips-themes/system/Dispatcher/Dispatcher.php(153): IPS\calendar\modules\front\calendar\_event->execute()
#9 /var/www/html/ips-themes/index.php(13): IPS\_Dispatcher->run()
#10 {main}

To repro:

  • Create an event that repeats every 6 years, with a start date in 2019
  • Try to view that event

This is because Event::nextOccurrence only searches within a couple of years, and returns null if it goes out of range, but get__happening doesn't handle null.

Link to comment
Share on other sites

  • 3 weeks later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Upcoming Events

    No upcoming events found
×
×
  • Create New...