Repeat Every Year with relative date don't work.

If I enter date: 8 January 2012 and Repeat option:
Repeat Yearly Every 1 Year on Second Sunday of January
Repeat stop 01/01/2099

I don't see date 13 January 2013 and other dates in node view and I can't get this dates from Views.
On page mysite.com/node/12345/repeats I see only first date (8 January 2012) and repeat rules.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Matthew Davidson’s picture

There's just no code for handling YEARLY repeats with BYMONTH rule parts in _date_repeat_calc(). This patch appears to do the trick. Please check it out for logic flaws; dates are hard, and my brain is really old and soggy.

Matthew Davidson’s picture

Status: Active » Needs review

... and I can never remember to change issue status.

Tobias Xy’s picture

Patch #1 solved the problem for me!

breezeweb’s picture

I can confirm Patch #1 fixes the problem also. Thanks!

Can this be patch be committed to HEAD as soon as possible? This is a significant functionality bug where a basic feature simply doesn't work at all.

breezeweb’s picture

Issue summary: View changes

change link

vijaycs85’s picture

Priority: Critical » Major
Issue summary: View changes
Issue tags: +Needs tests

Thanks for working on this issue. This case doesn't look like a critical as a module point of view. Downgrading to Major.

+++ b/date_repeat/date_repeat_calc.inc
@@ -265,7 +274,7 @@ function _date_repeat_calc($rrule, $start, $end, $exceptions, $timezone, $additi
+          date_date_set($current_day, $year, 1, 1); // TODO: There's yer problem!

Add comment in new line and would be great to have an issue with details and update issue link here?

Haven't tested manually yet, but looks like we can add some test to cover this case.

podarok’s picture

FileSize
5.1 KB

test
shoud fail

Status: Needs review » Needs work

The last submitted patch, 6: only-test.patch, failed testing.

podarok’s picture

Status: Needs work » Needs review
FileSize
5.24 KB

hate windows
should fail but proper patch file format

Status: Needs review » Needs work

The last submitted patch, 8: only-test2.patch, failed testing.

podarok’s picture

the trouble is that with and without https://drupal.org/comment/7086712#comment-7086712 patch function returns the same data.
Problem is not only in this place or I did something wrong

function _date_repeat_calc

is pure evil... needs re-factoring this spaghetti code

sashken2’s picture

Please add patch #1 in next realese.

phoehne’s picture

patch #1 works perfect. and it should be released because you can get an infinite loop if you use these types of dates with a stop-rule bound to number of occurrences which brings your site down!
(#10)Perhaps there are more problems, but i think its better than nothing.

greetings peter.

phoehne’s picture

Status: Needs work » Reviewed & tested by the community

patch #1: used it for a while now - no problems

The last submitted patch, 1: date_repeat-yearly_bymonth-1888968-1.patch, failed testing.

cafuego’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
6.68 KB

Rerolled the patches into one, and these should now apply as well.

cafuego’s picture

... and a tests-only version of the patch from #16.

parvind87’s picture

In Drupal 7.37, this patch no longer needed.

Chris Matthews’s picture

Status: Needs review » Closed (outdated)

In Drupal 7.37, this patch no longer needed.

Gribnif’s picture

Priority: Major » Normal
Status: Closed (outdated) » Needs review

I don't understand why this issue was closed. Changes in core in no way affected this issue. I can confirm that this patch is still needed. (It needs to be re-rolled to work against the current development branch, though.)