If a taxonomy term field is chosen to be included in a Calendar view it will not show. The issue filed in this link http://drupal.org/node/108071 covers how to make sure additional fields are included (though you actually have to add some additional code to the theme_calendar_node_month & theme_calendar_node_week functions in the calendar_api.inc to get them to show up in the Month and Week view).

However, it will not pick up taxonomy terms for a specific vocabulary when they are included as a field for the view. When I do a print_r on the node items I get an empty term_node_1_data variable. I can provide a views export dump if needed, but basically it is impossible at this moment to use taxonomy fields in any calendar view (day, month, or view). Though my nodes happen to be event nodes, I suspect this would be true of any node type.

I've tried following things back through the code, but I haven't been able to find out where the taxonomy data is being lost.

Comments

KarenS’s picture

Status: Active » Fixed

I think I finally found this bug and fixed in latest commit to all branches. Reopen if not.

hintbw’s picture

Status: Fixed » Active

The patch you reference in cvs includes the node->teaser which allows additional fields (if included) to show up in the view. However for taxonomy fields for a specific vocab, nothing is passed (it's like there is a problem getting that information from views). In an object view (using like print_r) those variables will show as term_node_x_data (with the x depending on how many different types of taxonomy fields you add to the view) but will be empty and are thus not outputted when the node is displayed through the calendar module. I can attach my view export if needed as well as provide you access to see the calendar if needed.

KarenS’s picture

I tested this with taxonomy terms and it worked fine, so I guess post an export of your view. You must have done it differently than I did.

hintbw’s picture

Karen,

Here is an export of the view. I will clarify that I noticed it worked with Taxonomy: Term but only brings in the first weighted taxonomy term (and for events that span multiple dates it starts duplicating them so that the same term shows up 3 times). Weird I know. Here is the export of my view the way I would like it and that way it is normally setup.

$view = new stdClass();
$view->name = 'monthly_reservation_calendar';
$view->description = 'Monthly calendar view of events, filtered by url arguments';
$view->access = array (
);
$view->view_args_php = 'if($args[0] == "currentmonth") {
$args[0] = date("Y",mktime());
$args[1] = date("m",mktime());
}
return $args;';
$view->page = TRUE;
$view->page_title = 'Computer Lab Reservations';
$view->page_header = 'Teachers: To schedule the lab, please login and click on the Add Reservation link to the left.';
$view->page_header_format = '3';
$view->page_footer = '';
$view->page_footer_format = '1';
$view->page_empty = '

No Reservations Scheduled Yet.

back';
$view->page_empty_format = '3';
$view->page_type = 'calendar';
$view->url = 'calendar/reservations';
$view->use_pager = FALSE;
$view->nodes_per_page = '0';
$view->sort = array (
);
$view->argument = array (
array (
'type' => 'calendar_year',
'argdefault' => '2',
'title' => '',
'options' => '',
'wildcard' => '',
'wildcard_substitution' => '',
),
array (
'type' => 'calendar_month',
'argdefault' => '2',
'title' => '',
'options' => '',
'wildcard' => '',
'wildcard_substitution' => '',
),
array (
'type' => 'calendar_day',
'argdefault' => '2',
'title' => '',
'options' => '',
'wildcard' => '',
'wildcard_substitution' => '',
),
);
$view->field = array (
array (
'tablename' => 'node',
'field' => 'title',
'label' => 'Title:',
'handler' => 'views_handler_field_nodelink',
'options' => 'link',
),
array (
'tablename' => 'event',
'field' => 'event_start',
'label' => '',
'handler' => 'views_handler_field_date_small',
),
);
$view->filter = array (
array (
'tablename' => 'node',
'field' => 'status',
'operator' => '=',
'options' => '',
'value' => '1',
),
array (
'tablename' => 'event_views',
'field' => 'event_type',
'operator' => 'OR',
'options' => '',
'value' => array (
0 => 'content-reserve_item',
),
),
array (
'tablename' => 'term_node_1',
'field' => 'tid',
'operator' => 'OR',
'options' => '',
'value' => array (
0 => '5',
1 => '4',
2 => '2',
),
),
);
$view->exposed_filter = array (
array (
'tablename' => 'term_node_1',
'field' => 'tid',
'label' => '',
'optional' => '1',
'is_default' => '0',
'operator' => '1',
'single' => '1',
),
);
$view->requires = array(node, event, event_views, term_node_1);
$views[$view->name] = $view;

KarenS’s picture

Status: Active » Fixed

Some of this may be a general problem of handling taxonomy when there are multiple taxonomy terms that apply to a node. That will create duplicate nodes, which will show up as duplicate items on the calendar and that is a basic Views issue (the same things happens with all Views displays), so I can't fix that here. If you want to see multiple taxonomy terms in your calendar teaser you may be better off leaving the taxonomy terms out of the view, then customizing the theme_calendar_calendar_node(). It currently just displays the fields in the view, but you could change it to do a node_load on each node, then display the taxonomy terms from the node in the calendar. I don't have time to give you an illustration of how to do that, but hopefully you can figure it out or someone else can post an example. If you can't figure it out, re-open this as a support request.

Any other problems related to this should be fixed in today's commits.

Anonymous’s picture

Status: Fixed » Closed (fixed)