The module is not working the way it is supposed to. I have a content type with CCK fields of Date type. It also has other CCK fields such as location. I created a view that allows me to see all the nodes of this content type in a calendar. I want the day view calendar to group items into columns by the field value location, and it's not happening. I've tried with Taxonomy fields, with text fields with nodereferenced field. The closer I've gotten to break the nodes into groups is when I group them by Node Title, but that is not want I want. Thank you,

Comments

markpayne’s picture

finlaycm,

Have you had a solution to this yet. I am having the same problem. Can group by standard node fields, title and username etc, but cannot group by CCK fields.

keith_k’s picture

I had the same problem at first. Then I realized that under my FIELDS, I was using "Group multiple values" for this CCK field. I removed this option and seems to be working fine now.

bricef’s picture

Hello,

I try to use this option but how can i display the field used to group contents? I want to print something like that :

Term1
-Content1
-Content2

Term2
-Content3
-Content4

Other question, is it plan to bring this option in week view?

Peter Törnstrand’s picture

Can't get this working either. No mather what field I enter in the "Field grouping" select box the output is the same.

joachim’s picture

There are three things I can see broken with this:

- the 'None' option doesn't properly exist; $grouping_field = $view->date_info->style_groupby_field gets set to an empty string and isn't tested for properly
- taxonomy terms don't work properly, as the grouping column is set as ''.
- the field name in $grouping_field = $view->date_info->style_groupby_field is not the same field name that the $items have in template_preprocess_calendar_day(). Hence the grouping will never work. I tried this with a CCK numerical field, and it's probably broken for everything.

Peter Törnstrand’s picture

For me it's working when grouping on taxonomy terms.

jonasob’s picture

I've dug into this a little bit, but I require some CCK knowledge in order to figure out the appropriate fix. I have a CCK text field with the name "room". In the database, this is stored as field_room_value.

In calendar_view_plugin_style.inc where we define the field grouping, the room field is defined as node_data_field_room_field_room_value, which to me seems reasonable. However, the QUERY which is sent in views selects node_data_field_date.field_room_value AS node_data_field_date_field_room_value. So suddenly it is interpreted as a date field. Thus in theme.inc, the $view->date_info->style_groupby_field will refer to a field which doesn't exist in the dataset returned by the SQL query. If I set $view->date_info->style_groupby_field manually to the correct field, as returned by the query, then it works perfectly.

jonasob’s picture

Here's another problem which I just discovered. If I want to use a field ONLY for field grouping, and I don't want to display it, I would normally select "Exclude from display" in the views. However, when looking at the code in themes.inc, if I do this, then the following

322 foreach ($rows['items'] as $time => $items) {
323 foreach ($items as $item) {
325 if (isset($item->{$grouping_field})) {

won't match, because the $grouping_field is not in the visible fields, even if it's in the result set. So in order to make this work, we can't check in $item, but we must check in $item->{raw}, as such:

325 if (isset($item->{raw}->{$grouping_field})) {

There's a few more places down from this point which also needs corresponding changes, as well as up around line 294 when we deal with all_day events.

lina.irshaid’s picture

ok make the location field in the calendar view not linked to its node. it will work for sure.

e5sego’s picture

Version: 6.x-2.0 » 6.x-2.x-dev

The method of resolution descriped by jonasob does not solve any case, the $item->raw->{$grouping_field} would also not match in my case.

As far I explored, an part of the fieldname is replaced with part of first field which is goind to display.E.g. the key set in the groupby option is "node_data_field_event_location_field_event_location_value" (correct), the key of the $item object during runtime is "node_data_field_event_datetime_field_event_location_value" (wrong), because the "field_event_datetime" is on top if the fields list.

Workaround without code-changes:

The grouping field have to be the same as the first field (under "Fields"). The field will not appear in the calendar cells, just int he column heads. You can add it twice if you need.

Artusamak’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

6.x is entirely unmaintained.