Here's my issue:
I've added two date fields to my event content type, each are allowed to have repeating dates, but I'm seeing all the repeating dates from the first date field in the date selected for the second date field. So for example if my field_date_first has a date set as well as a repeating date and my field_date_second has just a date set, in the calendar when the field_date_second renders it renders once for each of the field_date_first dates.

In the calendar view I've configured the contextual filter to include both date fields and am using the "OR" method. I don't believe there is a misconfiguration in my view but that the calendar, when building items to display, needs some additional filtering. I've attached a patch that restricts multiple duplicate items from the $items array. The unique key for an item is built from the item ID, item start date, and the item start time. If this "key" has been used before it's not added to the $items array. I'm not sure if it's the best solution, but it fixes the issue I'm having. The patch was made against the 7.x-3.4 version hence why 3.4 was selected for this issue rather than 3.x.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

greenSkin’s picture

I am sure I'm not doing this right, but here's an updated patch that also prevents showing items that have a calendar start date greater than the calendar end date. This is probably a separate issue, related to the date argument but thought I'd post this here to get some eyes on it and someone more familiar with the context can route it where it needs to go.

sinmanteca’s picture

Thanks for the patch -- I had a related issue with using two date fields with repeating dates from the same entity in the calendar view. Adding the second date to the contextual filter with the "OR" configuration was generating an AJAX http error. The patch in #1 solved this problem.

sinmanteca’s picture

I take that back! The patch prevented an AJAX http error in the calendar view preview but the page view still generated an http error 500. My solution was to reduce the duration/number of repeated dates. Patch #1 was still useful for applying the additional filtering as described by the author above.

ethos_bass’s picture

I've been posting in an open issue for the Date module with a similar problem, but I'm thinking I should bring it over to the Calendar module issues.

Here's the discussion: https://drupal.org/node/2004786

rvillan’s picture

This worked for me, thanks! Here it is in a .patch file.

apaderno’s picture

Version: 7.x-3.4 » 7.x-3.x-dev
Category: Task » Support request
Status: Needs review » Active
Neslee Canil Pinto’s picture

Status: Active » Closed (outdated)

Hi, there will be no more future development for 7.x branch. If you see this issue in 8.x, feel free to file an issue. Close this as Outdated.