I saw another issue with this problem that appears to have been closed and fixed, so here is another one. In particular this RRULE is causing timeouts which I assume are related to an endless loop

RRULE:FREQ=DAILY;INTERVAL=1;BYDAY=MO,WE,FR;UNTIL=20090924T000000;WKST=MO

It is the BYDAY portion that specifically seems to be problematic. If I remove that then everything works fine. I'm on PHP 5.2.6 and Drupal 6.4 and I'm running the latest -dev release of date. I've attached an export of my field description if that is any help.

I'm digging into this but I'm having some trouble getting my head around the code.

CommentFileSizeAuthor
#5 312996.patch405 bytesgdd
export.txt2.13 KBgdd

Comments

gdd’s picture

Title: Date Repeat with causes endless loop » Date Repeat with BYDAY causes endless loop

fixing stupid title typo

karens’s picture

Status: Active » Postponed (maintainer needs more info)

I can do that just fine. The only difference between my RRULE and yours is the start day (you're using Monday as the first day of the week?), so I tried that, too, and it spit the answer out in just a couple seconds either way.

I've made some commits in the last couple days, including today, that affect repeats, but nothing that should affect this issue.

Do update to the latest code and try again, though. There is an update.php to run because I now have separate widgets for repeating and non-repeating dates so the Content module can handle non-repeating multiple value dates in the usual way, so the update will swap in the new widgets.

If you still see problems after that, what other modules do you have installed? Maybe there is something else going on here.

karens’s picture

Or maybe it is the same as #302678: Maximum execution time in date.theme on line 227 (which I also can't replicate).

Can you tell me exactly how the date you're using is configured and exactly what you used as a start date and for other repeat options.

gdd’s picture

Start Date: 09/24/2008
Reapeat: Every Day Until
End Date: 09/24/2009
Advanced: Any Month, Any Day of Month, Monday/Wednesday/Friday for Day of Week
Nothing for Except

I will try this again with HEAD tomorrow, I did use the latest -dev when I posted the issue.

I did do some debugging last night. It is getting stuck in the loop which starts at line 259 of date_repeat_calc.inc, $finished is never getting set. It successfully creates the full array of dates and then just loops forever. I was hoping to throw the debugger at it today because there's a lot of data that influences things in there, but I didn't get around to it.

gdd’s picture

Status: Postponed (maintainer needs more info) » Needs work
StatusFileSize
new405 bytes

So, with this particular set of dates, $finished gets set correctly to TRUE at line 275, however the loop does not exit, and after $current_day goes through a couple modifications, $finished gets reset back to FALSE at line 310 which causes the loop to repeat endlessly. I have attached a patch

I have verified this is still happening with the most recent dev version.

I am using the attached patch for the moment, but I'm unsure if it is a good long-term solution or not as there are a lot of variables and its not really tested.

karens’s picture

This analysis is very helpful, I'm doing some testing to see if this fix will create any other problems, but it seems like it makes sense.

karens’s picture

I think your fix will work as it should, I haven't run into any situations where it breaks anything else so I'm going to commit it.

Thanks!

karens’s picture

Status: Needs work » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.