PHP Fatal Error
-
Hello,
I am using the Lite calendar on a site for family that is private, so I cannot include the link.
I’m using a shortcode on a page to render a weekly view with a Start Date of the Current Week. The Next/Previous Buttons are enabled, the Single Event display method is Current Windows. The only activated filter option is to Include Expired Events.
We’re currently in January 2022 and that displays fine. I can then advance normally through Feb, Mar & Apr. I can also go backwards through event month in 2021. However, if I try to advance to May 2022, the loading circle in the display just spins forever.
Looking into the PHP error log of the server, I can see that the process trying to retrieve the data runs for the allotted PHP maximum of 120 seconds and then times out. In each case that it does this, the PHP fatal error returns in the while loop in /wp-content/plugins/modern-events-calendar-lite/app/libraries/render.php on line 1215.
Doing some research by placing error_log lines in the file inside the while loop, I can see that this is for events with a type of yearly, which this site has a number of because of in May because of birthday entries. If I output the result of
$found < $maximum
from the while statement,$found
is always 0.Looking deeper, I find that the
if(!in_array($month, $event_months))
on line 1224 gets taken every time meaning that there is never a match between the month (05) and the content of the$event_months
array. As a result, $i just increments ad infinitum and, the loop is continued and the while never breaks.I’ve worked around this issue temporarily by placing a short-circuit in the while loop definition that checks if
$i
has exceeded 25. This does result in the display working. However, this is clearly not the answer, just a preventative step to stop lots of runaway processes.I am running the latest plugin (6.2.5) on WordPress 5.8.3 on a server running PHP 7.4. Everything else in ME Calendar is working nicely and normally.
Any thoughts would be most appreciated.
Thank you!
- The topic ‘PHP Fatal Error’ is closed to new replies.