Closed (fixed)
Project:
Date
Version:
5.x-2.0-rc7
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
22 Aug 2008 at 14:34 UTC
Updated:
18 Nov 2008 at 20:52 UTC
i haven't tested this thoroughly yet, so i apologize if i don't entirely understand this issue. when i create a non-calendar view (say, a view of teasers) that includes nodes with a date field, items show up in the view for every instance of the repeat pattern. is there a way to configure this to not show duplicates? if not, is it a bug or is it the designed behavior?
Comments
Comment #1
michaek commentedsometimes it's not clear to me whether issues should be raised in date or calendar - this one may have been more appropriate under calendar, though i'm not certain. the behavior i described seems to be a result of the join on the content_field_[repeat_date] table, and each instance of an event with a repeat pattern has a record in the table - hence multiple items in the view.
for my purposes, the following code within an implementation of hook_views_query_alter() seems to suffice, but i don't want to offer it as a patch, because it smells like a hack to me (and i'm still familiarizing myself with both this module and views/cck). (most of the logic here is obviously lifted from _calendar_views_query_alter())
what it's doing: for each calendar field in the view, check to see if "Group multiple values" is selected for that field definition in the view. if so, add a where condition to select only the record in content_field_[repeat_date] that matches the delta of the calendar field. (my assumption is that this record always contains the rrule - if that's not true, this code won't be reliable.)
Comment #2
karens commentedIf you're creating a regular view, the regular way -- no calendar involved -- and you're using repeating dates, you have multiple values for the same node. All CCK multiple values will show up multiple times in Views unless you choose the 'group multiple values' option when you set up the field in the view. That's the way all multiple value CCK fields work, date is no different.
If you're not talking about calendar views, I'm not sure why you're suggesting a patch to the calendar code, so I'm confused completely about that.
Comment #3
karens commentedNo response to #2 in many weeks, assuming that was the problem.
Comment #4
benkewell commentedif the date repeat field is used to filter the nodes,
it will end up having duplicate instant of the same node in the view for each day in the field
not related to the cck display option
i used the date repeat field to hold the days that a course is held for a social center
and then try to use view to filter out courses that are not started yet
so i set the view filter on the date repeat field as " date_field >= now "
as a course may have several days, it then appears in the view result as several entries
it may be made distinct by the distinct filter in views 1.6
but seems not working in drupal 6 views 2
so better have it solved in the date module...
Comment #5
karens commentedYou have reopened an issue for Date version rc7 (which is way out of date and no longer applicable) to discuss something in the D6 version, a version which is totally different. Don't do that. Plus I have absolutely no idea what you're trying to say.