I have a node type with an optional event date field. I want to create a view that will show all nodes where either the event date is >= now or null. In addition, I only want to display the next instance if the event date is repeating.

When I don't check the "Group Multiple Values" box in the date field display settings of the view, it displays as I expect - with all instances of a repeating date from now through the end of the repeat range included. But when I check "Group Multiple Values" in the field display definition for the event date, the view reverts back to displaying the first instance of the event date. None of the parameters I enter for "Group Multiple Values" seem to make a difference. Whenever it is checked, the view only shows one instance of the node with the original event date.

Comments

Anonymous’s picture

But the behaviour described is exactly what I want to be able to do. I want to be able to create a view containing a single instance of the node, with the original start date and repeat details, and filter on the start date as above. (Ideally also filter on the "Until" date in a Repeating Date, but I can see that is a bit harder.)

Also to have the same set of nodes displayed whether the output format is set to Fields or Nodes view (which seems to make a difference at present).

(See http://drupal.org/node/355571 for some problems in the 6.x-2.0-rc6 version in making this work. It looks as if at least some of this has been fixed in this dev version which is good.)

Please don't destroy one user's preferred behaviour to satisfy another.

With thanks, Tony

ceaker’s picture

I'm a little confused about how my description could be desired behavior. In my description, when "Group Multiple Values" is not checked for the date field display, the view shows multiple instances of a single node with a repeating date and dates that occurred in the past are excluded. This is exactly what I expect.

However, I only want the next occurrence of the repeating date to show up in my view. To make that happen, I am checking the "Group Multiple Values" checkbox and telling the view to display 1 value. When I do this, it displays one value with the first instance of the repeating date, even though that date should be excluded by my filter criteria. I've tried setting the "Starting from" parameter to 1 and 'now' and get the same thing in both cases. Also, if I set the parameters in the "Group Multiple Values" to show 'x' values where x>1, it still shows only one value - the original date of the repeating date.

I've got a software development background, but no experience with drupal module development or php in general. While getting started in views/CCK/date seems kind of like jumping in the deep end of a pool to learn to swim, I'd be willing to give it a go if someone could at least point me in the right direction with respect to which php files are handling the "Group Multiple Values" parameters.

ceaker’s picture

As I think about this more, I'm starting to realize what is likely the root of my problem and that perhaps this is more a feature request than a bug. I'm realizing that repeating dates are technically not the same as multiple dates. However, it seems that intuitively, repeating dates should be treated the same as multiple date values in terms of how the "Group Multiple Values" settings work. I can imagine how this might get pretty complex, especially if you have a node with a combination of multiple and repeating dates.

I'd like to get some feedback from folks on this. In general, should repeating dates be treated the same as multiple dates with respect to the behavior of "Group Multiple Values"? Personally, I think they should, but I admit I might be suffering from a case of tunnel-vision from looking at the particular problem I'm trying to solve and I didn't entirely understand Maynard's concerns above.

ceaker’s picture

Title: Repeating dates broken for views with "Group Multiple Values" checked in field display settings » Modify "Group Multiple Values" handling for repeating dates
Category: bug » feature
Priority: Critical » Normal

After thinking about this more and reading through similar threads, I'm changing this from a bug report to a feature request. Currently, it appears that "Group Multiple Values" does not consider repeating dates to be multiple values and overrides the filter settings for repeating dates. But conceptually, it seems that the only difference between multiple date fields and repeating date fields is that multiple date fields can handle schedules that can't easily be described by a repeat rule. It would be nice to see both handled similarly by the "Group Multiple Values" option.

If this a fundamentally bad idea or I'm completely misunderstanding the use of repeating vs multiple date fields, please help me understand before I invest a lot of time working on a patch that will be ultimately rejected.

Anonymous’s picture

When I looked at this I certainly expected repeating dates and multiple dates (and indeed From/To dates which are another alternative) to be just two ways to enter a schedule of dates, and expected both to behave the same when it came to filters or Group Multiple Values.

Having said that, there are clearly a lot of different requirements out there which may mean this won't work, but I would certainly go for commonality if one can.

------

My point above illustrates one of the different requirements: I am using repeating dates to define a course of lectures/classes, e.g. every Tuesday from Start to End, Except half term. It does that fine. I have a number of such courses, and I then want a View which filters out past courses and returns just one entry for each current or future one, showing the title, start and end dates. I can return the whole node OK, but if I just want the selected fields format I can't find a combination of filters, Group Multiple, etc. which works.

If someone can show me how to do this, then that would be great. It may be to do with the different behaviour of the "node" and "fields" formats, which just confuses things further.

---

(If I have it right) the original poster (and many others) views each repeat as a separate "item" and wants them shown separately in Views. I understand that, and indeed in other cases would want it as well. I am pointing out that there is also the case where the whole set of repeats is actually the "item" of interest, and am looking for a facility to access that as a single entity.

Regards, Tony

karens’s picture

Status: Active » Fixed

I just committed a new feature to -dev that should take care of this and more. The formatters now have settings so you can do choose to show or not show the repeat rule, display all repeats or the first repeat or the next repeat from today or whatever. You can also choose if you want to display both the from and to dates, or just the 'From' date or just the 'To' date.

If you use Advanced Help you'll see some popup help for this. The formatter settings are on the Display fields page and when you add Date fields to views.

I'm sure it will still need some tweaking to produce the right results everywhere, but so far in my testing it works to make this all very customizable.

If there are no immediate bugs, I'm planning to roll a new release with this in it.

That does not address the issue about creating repeating dates as separate nodes, but that is a different issue.

Anonymous’s picture

I've just seen the new release - I'll get onto it asap.

Thanks for all your efforts,
Tony

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.