The Continuing Quest for Repeating Events

Events happening in the community are now at Drupal community events on www.drupal.org.
MacaroniDuck's picture

I am on a continuing road to allow users to efficiently create repeating events. The use case is a site dedicated to unplugged gamers in the community (think board games, RPGs, card games, etc.) at tuga.unpluggedgaming.org I've recently invited some of the main people in the community to start using it. I have to think the issue I'm posting below has come up for anyone creating any kind of calendaring event system, so hopefully there are some answers out there and/or this might help others as well.

What has been a thorn in my side from the beginning has been being able to create repeating events. I understand that date issues are complex and the reason that many huge sites like Ning still haven't implemented them and, I believe, Meetup only did successfully just last year. To me it seems like Drupal is very close to being able to provide this, but is missing just a bit more fit and polish.

Here's where I'm at now and would appreciate any feedback on modules I might have missed and/or resources to get this done. It seems like what I need is pretty straightforward and might be covered by a reasonable bounty, for example.

The Date API already provides the ability to create a repeating sequence of dates for a single node. But, for various reasons, I need every event to be a separate node. Here is my "ideal workflow".

  • User Creates Event
  • Within Event creation process, user can choose to make event recurring and choose recurring pattern (this is actually how doing this through Date API currently works)
  • Nodes are created for each instance of the event and connected to the original in some way
  • All but the initial node start as unpublished
  • User enters a preference for when each node will be published automatically by the system (i.e after the previous instance is over or "5 days before the event date").
  • Initial event is created and rest are queued for publishing.

So, here is where I've gotten:

  • Clone Node is an alternate option in that it allows you to duplicate a node and carry out everything else above with the help of the Scheduler mod (or Rules if you want to do more work - and I don't). The problem being that you have to do each event one at a time.

  • Node Repeat does a good bit of this. It ties into Date API and creates a sequence of nodes based on the recurrence pattern that you choose. Coupled with Scheduler it initially provides the functionality I'm looking for (though it has a couple of issues being worked out). The problem is that it is prone to user error.
    You have to create the initial event and then click a "Repeat" tab to create your sequence. This is not a deal breaker if everything else can be accomplished.
    Currently users can choose to have all events in the sequence either be Published or Unpublished. This is an issue because we rely on notifications/messaging and if someone creates 20 published instances of a recurring event, that means 20 emails to everyone getting Event notifications. Bad scene.
    Currently the user would then have to edit each individual node and enter a date/time for the instance to be published via Scheduler. Very tedious.

So, my needs with this have been narrowed down to:
Force nodes created through Node Repeat to start as unpublished
Allow the user to enter a rule for when the future nodes get published
optimally, integrate all of that with the initial node/event creation (pie in the sky)

My ultimate questions are:
Are there nodes available that might help me accomplish this that I haven't found?
Have people utilized better/different ways to accomplish this functionality/workflow?
Can Rules potentially be used to accomplish some/all of this? I'm almost completely illiterate with PHP and haven't worked with Rules at all so I'm at a loss there.
Am I close enough that the rest of the functionality should be fairly easy to implement or am I missing some major concerns/conflicts/issues?

Comments

Have you figured anything out

BrandonDL's picture

Have you figured anything out as far as this is concerned?

+1 for Rules

PeteS's picture

Even 1.5 years after the initial post, I would definitely explore using Rules if I were doing this myself. There may be other modules by now that attempt to do this, but you're bound to run into some limitation or configuration requirement that the module won't support. With Rules, you can set up a scheduled daily task that will scan through all initial event nodes, maybe look at repeating event configuration data that you could store in the Event content type (e.g. add a field that indicates how often the event is repeated, and then Rules can look at that field and make a decision at runtime about whether to create a new node).

To make it more robust, you might want the whole thing wrapped in a component that accepts a date as an argument, and then instead of automatically creating new nodes, it would check for the existence of the node that you want to be created, and only create a new one if it's not already there. That way you can execute your rule(s) as an idempotent task, which will be more resilient to failure (e.g. what if your server has a memory hiccup in the middle of the rule being executed, and the script dies?)

No Love Yet

MacaroniDuck's picture

Hey Brandon,
I've not yet found a great solution. Granted, about six months ago I stopped staying on top of things. There has been some module development that attempts to address this, but I haven't had an opportunity to fully investigate it.
As for Rules, this needs to be something that is created instantaneously so I'm assuming it would require a good bit of PHP coding to create the nodes properly. Rules in and of itself wouldn't know how to create nodes on a bi-weekly basis, for example, right?
Why re-write the wheel? The core Date module already has the ability to create recurring events. It simply doesn't do so as separate nodes. All that's needed is something that hooks into what the Date module already does to create the nodes. Perhaps that can be accomplished with Rules, but it's beyond my capabilities.

Thanks for the responses

BrandonDL's picture

Thanks for the responses after such a long time!

I think what I'm going to end up doing is just creating manual nodes based on each event date. I'll just check to see if

count($node->field_event_dates[$node->language]) > 1

and then go from there with just creating and reading from custom nodes. What I'm trying to do is allow users to create feedback for each event day. However I see a problem that will arise when it comes to using views to view feedback. I'll have to custom write code to deal with that as well.

Have you seen this

DeNelo's picture

The Date Repeat module? http://drupal.org/project/date_repeat_instance : Date Repeat Instance provides edit and delete links per instance of a repeating date series.
Haven't tried it though, just stumbled upon it.

Curious if Anyone Has Actually Pulled This Off

MacaroniDuck's picture

I long ago abandoned trying to use Drupal to make this happen for the site I was working on. For another project, I was taking a look to see where things have gotten and found this: https://www.drupal.org/project/date_repeat_entity

It sounds like the answer, but would love to hear from someone that's actually used it in production. Or even come up with some other solution.

Not a fan of Date Repeat Entity

jhmoore's picture

I tried using Date Repeat Entity for a site, but it threw all sorts of error messages on event creation and update. I posted to the module forum about this almost two months ago and I haven't heard anything back.

Also, what date repeat entity does is it takes an event and creates multiple nodes, each of which is independently editable. That means if it turns out there's a mistake in the original content (or some detail later becomes outdated), you have to go through each node individually to correct/delete the error.

After several attempts to devise my own solution to the repeating events issue, I'm currently looking at using the Calendar module (https://www.drupal.org/project/calendar). It has repeating events right out of the box, and it has a nice set of Views bundled in that you can customize to no end. I haven't used it in production yet, but so far I haven't been able to come up with a test case that it can't handle.

Would you tell me how to get

rwilson0429's picture

@jhmoore, would you tell me how to get to the Calendar module's repeating events feature? From what I can tell from the calendar's project page, the Calendar module "will display any Views date field in calendar formats".

I've installed the Calendar module but, I couldn't find where it has any repeating date features other than displaying them in a calendar format.

Thank you for the quick

MacaroniDuck's picture

Thank you for the quick feedback! Doesn't sound like it's a very good answer.

Unfortunately my need was for something that did create each individual event in the recurrence as an individual node. This is important so that details of each event can potentially be different (location, start/end time, RSVPs, etc.) Think, Meetup.com type functionality.

I'm actually writing

dpickerel's picture

I'm actually writing something similar to this for a customer. We're using the sign-up module so people can make appointments at her clinic, but they have to be unique so they get tracked, reminder emails, etc..

I'm trying to get a time javascript library to work so she can do something like mon jan 15 - march 10 on tuesday, wednesday, and thursday from 5pm - 10pm, then batch to create the nodes because it takes so long and because create node no longer returns control to the calling function. I'm using the node import module to create the actual node, so it could be any node you exported in a copy and paste format that was used.

triDUG

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: