I've seen a number of cases where I end up with multiple renderings of the same event on the same date. While I've not tracked this down to the root cause, I have a request about some code within eventrepeat_render_nodes() near the bottom.
//now we need to run a check to see if this sequence should be closed. run an update request based on the new
//last rendered value. if no dates are returned, then close the sequence
$dates_to_render = _eventrepeat_render_nodes($repeatpattern['rid'], NULL, $update = TRUE, FALSE, FALSE);
$update = FALSE;
if (!$dates_to_render) {
db_query("UPDATE {event_repeat} SET repeat_last_rendered = %d WHERE rid = %d",
$repeatpattern['repeat_end'], $repeatpattern['rid']);
}
When $dates_to_render is NULL on account of there being no further nodes to render, we set repeat_last_rendered equal to the optional repeat_end value in the repeat pattern. In most of my cases a repeat_end date was never set, so that value is zero.
Is setting the repeat_last_rendered to zero really the right way to close out a run? When running through debug sessions this appears to kick off rendering from the start all over again.
I'm asking in the context of having overhauled eventrepeat to not create nodes, but instead small records with just date/time of the event instance information. I suspect that I've created this problem myself and am looking to understand the intended logic. That said, I did see duplication of nodes in the straight eventrepeat module when I was using it early on in my development cycle. The problem appears to happen as a side effect of viewing event calendars rather than through the cron runs.
Comments
Comment #1
seanbfuller commentedScott, can you please confirm that this is being handled / was handled by http://drupal.org/node/93256 or http://drupal.org/node/86924 so that I can mark this as a duplicate issue?
Comment #2
scott.mclewin commentedIt is. This was where I first began to realize how the duplicated events problem was likely being caused.