I had the following functionality programmed. I will provide a patch in the next comment. I hope this can get into the main release, since I'm sure others would love this functionality.

Basically, for an event type system, I needed to create a form of a Holiday date on a node, that would auto repeat forever into the future.

However, choosing "Stop repeating - After: 99999 occurrences" wasn't optimal because it creates all the dates at once, and due to performance implications doesn't work when multiple users are doing this same action at the same time. So instead, the following patch provides a new option "Never" with a "PHP strtotime formatted" field.

If I were to add "1 month" into the field, after hitting save, it would add 1 month of occurrences. Every additional site cron run will pull the offset and keep the "1 month" value always current. So if a week has passed, it will pull any occurrences for that passed week that would be valid within that "1 month".

When testing out the patch, be sure to turn on Date caching.

Also, please note, that I am not very PHP savvy, which is why I had this programmed, so I would love any alterations to the patch.

Members fund testing for the Drupal project. Drupal Association Learn more

Comments

NWOM’s picture

Status: Active » Needs review
FileSize
14.49 KB
FAILED: [[SimpleTest]]: [MySQL] Invalid patch format in date.stop_repeating_never.patch. View

Here is the patch based on the current dev shown on the project page (7.x-2.6+2-dev).

Status: Needs review » Needs work

The last submitted patch, date.stop_repeating_never.patch, failed testing.

Anonymous’s picture

Issue summary: View changes

Spelling and typos corrected.

shortspoken’s picture

Any news? Has anyone tested the patch?

cameronbprince’s picture

Here's a re-roll of the patch against the current version of date, but sadly it doesn't work. There are no errors, but when you create a date and then come back and edit it, the values that were entered don't appear to have been saved.

For now I'm going to just go with a high repeat count.

Road Kill’s picture

I am also looking for a feature like this it would be awesome if it makes into the next release.

vtcore’s picture

Priority: Normal » Major
Status: Needs work » Needs review
FileSize
12.57 KB

Here is an updated patch. It's not tested thoroughly, but it seems to work.

laurelstreng’s picture

Applied the updated patch, and the 'Never' option appears, but I don't think it's working any more? Using the calendar module as well the node only appears once in the calendar even though it's been set to repeat & never stop repeating.

Using the latest Drupal 7.50

DamienMcKenna’s picture

Status: Needs review » Needs work

This needs minor improvements to adhere to the Drupal coding standards, specifically whitespace around brackets, comments before new functions, etc.

jmuzz’s picture

Status: Needs work » Needs review
FileSize
12.93 KB

Cleaned it up, tweaked the help text, and added a default value that should have it working for most use cases.

Status: Needs review » Needs work

The last submitted patch, 9: date-stop_repeating_never-2076639-9.patch, failed testing.

DamienMcKenna’s picture

Status: Needs work » Needs review
FileSize
12.52 KB

@jmuzz: When you create patches please make sure they are created correctly otherwise the testbot can't test them.

Here's #9 fixed up so it should apply cleanly.

Status: Needs review » Needs work

The last submitted patch, 11: date-n2076639-11.patch, failed testing.

jmuzz’s picture

Status: Needs work » Needs review
FileSize
12.91 KB
572 bytes

My bad.

Not sure this will fix the test failure but it does fix my migration problem.

Status: Needs review » Needs work

The last submitted patch, 13: date-stop_repeating_never-2076639-13.patch, failed testing.

dsouza_rohan’s picture

dsouza_rohan’s picture

Status: Needs work » Needs review
dsouza_rohan’s picture

Adding credit comments