Calendar Views support: The date argument date fields must be added to this query. You can exclude them if you do not want them

skyredwang - August 5, 2009 - 14:56
Project:Calendar
Version:6.x-2.2
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:by design
Description

#1

skyredwang - August 5, 2009 - 14:59

I was using 2.1 version without any problem, but after upgrading to 2.2, the Calendar Views(2.6) always gives me a error message: The date argument date fields must be added to this query. You can exclude them if you do not want them.

I have double checked that each of the calendar view has date in both argument and fields. So, I don't know what the problem is.

Below is my exported Calendar Views, I am not sure if this exported version is my working version, since the error prevents me saving the views

#2

skyredwang - August 5, 2009 - 14:59

$view = new view;
$view->name = 'calendar';
$view->description = 'A multi-dimensional calendar view with back/next navigation.';
$view->tag = 'Calendar';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
'title' => array(
'label' => '',
'link_to_node' => 1,
'exclude' => 0,
'id' => 'title',
'field' => 'title',
'table' => 'node',
'relationship' => 'none',
),
'field_datetime_value2' => array(
'label' => 'Event Date and Time',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'link_to_node' => 0,
'label_type' => 'widget',
'format' => 'time',
'multiple' => array(
'multiple_number' => '',
'multiple_from' => '',
'multiple_to' => '',
'group' => TRUE,
),
'repeat' => array(
'show_repeat_rule' => '',
),
'fromto' => array(
'fromto' => 'both',
),
'exclude' => 0,
'id' => 'field_datetime_value2',
'table' => 'node_data_field_datetime',
'field' => 'field_datetime_value2',
'relationship' => 'none',
'override' => array(
'button' => 'Override',
),
),
'field_location_nid' => array(
'label' => '',
'link_to_node' => 1,
'label_type' => 'none',
'format' => 'default',
'multiple' => array(
'group' => TRUE,
'multiple_number' => '',
'multiple_from' => '',
'multiple_reversed' => FALSE,
),
'exclude' => 0,
'id' => 'field_location_nid',
'table' => 'node_data_field_location',
'field' => 'field_location_nid',
'relationship' => 'none',
'override' => array(
'button' => 'Override',
),
),
));
$handler->override_option('sorts', array(
'field_datetime_value' => array(
'order' => 'ASC',
'delta' => -1,
'id' => 'field_datetime_value',
'table' => 'node_data_field_datetime',
'field' => 'field_datetime_value',
'relationship' => 'none',
),
));
$handler->override_option('arguments', array(
'date_argument' => array(
'default_action' => 'default',
'style_plugin' => 'default_summary',
'style_options' => array(),
'wildcard' => 'all',
'wildcard_substitution' => 'All',
'title' => '',
'breadcrumb' => '',
'default_argument_type' => 'date',
'default_argument' => '',
'validate_type' => 'none',
'validate_fail' => 'not found',
'date_fields' => array(
'node_data_field_datetime.field_datetime_value' => 'node_data_field_datetime.field_datetime_value',
),
'year_range' => '-3:+3',
'date_method' => 'OR',
'granularity' => 'month',
'id' => 'date_argument',
'table' => 'node',
'field' => 'date_argument',
'relationship' => 'none',
'default_argument_user' => 0,
'default_argument_fixed' => '',
'default_argument_php' => '',
'validate_argument_node_type' => array(
'blog' => 0,
'poll' => 0,
'image' => 0,
'job_posting' => 0,
'multichoice' => 0,
'quiz' => 0,
'forum' => 0,
'book' => 0,
'brand' => 0,
'chain' => 0,
'distributor' => 0,
'event' => 0,
'festival' => 0,
'importer' => 0,
'list' => 0,
'page' => 0,
'product' => 0,
'retailer' => 0,
'story' => 0,
),
'validate_argument_node_access' => 0,
'validate_argument_nid_type' => 'nid',
'validate_argument_vocabulary' => array(
'1' => 0,
'3' => 0,
'5' => 0,
'6' => 0,
'7' => 0,
'4' => 0,
),
'validate_argument_type' => 'tid',
'validate_argument_php' => '',
'override' => array(
'button' => 'Override',
),
'default_options_div_prefix' => '',
'validate_argument_node_flag_name' => '*relationship*',
'validate_argument_node_flag_test' => 'flaggable',
'validate_argument_node_flag_id_type' => 'id',
'validate_argument_user_flag_name' => '*relationship*',
'validate_argument_user_flag_test' => 'flaggable',
'validate_argument_user_flag_id_type' => 'id',
'validate_argument_is_member' => 0,
'validate_user_argument_type' => 'uid',
'validate_user_roles' => array(
'2' => 0,
'6' => 0,
'4' => 0,
'3' => 0,
'7' => 0,
'5' => 0,
),
'validate_argument_transform' => 0,
'validate_user_restrict_roles' => 0,
'image_size' => array(
'_original' => '_original',
'thumbnail' => 'thumbnail',
'preview' => 'preview',
'icon' => 'icon',
),
'validate_argument_signup_status' => 'any',
'validate_argument_signup_node_access' => 0,
),
));
$handler->override_option('filters', array(
'status' => array(
'operator' => '=',
'value' => 1,
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'status',
'table' => 'node',
'field' => 'status',
'relationship' => 'none',
),
'type' => array(
'operator' => 'in',
'value' => array(
'event' => 'event',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'type',
'table' => 'node',
'field' => 'type',
'relationship' => 'none',
),
));
$handler->override_option('access', array(
'type' => 'none',
'role' => array(),
'perm' => '',
));
$handler->override_option('cache', array(
'type' => 'none',
));
$handler->override_option('title', 'Calendar');
$handler->override_option('header_format', '1');
$handler->override_option('header_empty', 0);
$handler->override_option('footer', 'To add an event, click the “Add+” link at the top of the calendar. If you do not see this link, please contact us to request permission to add events. You must be affiliated with a Great Brewers Alliance wholesaler to add events to this calendar.');
$handler->override_option('footer_format', '1');
$handler->override_option('footer_empty', 0);
$handler->override_option('items_per_page', 0);
$handler->override_option('use_more', 0);
$handler->override_option('style_plugin', 'calendar_nav');
$handler = $view->new_display('calendar', 'Calendar page', 'calendar_1');
$handler->override_option('relationships', array(
'field_location_nid' => array(
'label' => 'Retail Location',
'required' => 0,
'delta' => '0',
'id' => 'field_location_nid',
'table' => 'node_data_field_location',
'field' => 'field_location_nid',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
),
));
$handler->override_option('filters', array(
'status' => array(
'operator' => '=',
'value' => 1,
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'status',
'table' => 'node',
'field' => 'status',
'relationship' => 'none',
),
'type' => array(
'operator' => 'in',
'value' => array(
'event' => 'event',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'type',
'table' => 'node',
'field' => 'type',
'relationship' => 'none',
),
'province' => array(
'operator' => 'is',
'value' => '',
'group' => '0',
'exposed' => TRUE,
'expose' => array(
'use_operator' => 0,
'operator' => 'province_op',
'identifier' => 'province',
'label' => 'State',
'optional' => 1,
'single' => 0,
'remember' => 0,
),
'id' => 'province',
'table' => 'location',
'field' => 'province',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'field_location_nid',
),
));
$handler->override_option('path', 'calendar');
$handler->override_option('menu', array(
'type' => 'normal',
'title' => 'Calendar',
'description' => '',
'weight' => '0',
'name' => 'primary-links',
));
$handler->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
));
$handler->override_option('calendar_colors', array(
'0' => array(),
));
$handler->override_option('calendar_colors_vocabulary', array(
'6' => 6,
));
$handler->override_option('calendar_colors_taxonomy', array(
'939' => '#eac561',
'942' => '#0c4cd4',
'944' => '#ffffff',
'943' => '#868f05',
'941' => '#a70d0c',
'938' => '#a90a8c',
'940' => '#1f6704',
));
$handler->override_option('calendar_popup', '1');
$handler->override_option('calendar_date_link', 'event');
$handler = $view->new_display('calendar_block', 'Calendar block', 'calendar_block_1');
$handler->override_option('block_description', 'Calendar');
$handler->override_option('block_caching', -1);
$handler = $view->new_display('calendar_period', 'Year view', 'calendar_period_1');
$handler->override_option('style_plugin', 'calendar_style');
$handler->override_option('style_options', array(
'display_type' => 'year',
'name_size' => 1,
'max_items' => 0,
'truncated_fields' => array(),
'truncate_length' => '',
));
$handler->override_option('attachment_position', 'after');
$handler->override_option('inherit_arguments', TRUE);
$handler->override_option('inherit_exposed_filters', TRUE);
$handler->override_option('displays', array(
'calendar_1' => 'calendar_1',
'default' => 0,
'calendar_block_1' => 0,
));
$handler->override_option('calendar_type', 'year');
$handler = $view->new_display('calendar_period', 'Month view', 'calendar_period_2');
$handler->override_option('style_plugin', 'calendar_style');
$handler->override_option('style_options', array(
'display_type' => 'month',
'name_size' => '99',
'with_weekno' => '1',
'date_fields' => NULL,
'max_items' => 0,
'truncated_fields' => array(),
'truncate_length' => '',
));
$handler->override_option('attachment_position', 'after');
$handler->override_option('inherit_arguments', TRUE);
$handler->override_option('inherit_exposed_filters', TRUE);
$handler->override_option('displays', array(
'calendar_1' => 'calendar_1',
'default' => 0,
'calendar_block_1' => 0,
));
$handler->override_option('calendar_type', 'month');
$handler = $view->new_display('calendar_period', 'Day view', 'calendar_period_3');
$handler->override_option('style_plugin', 'calendar_style');
$handler->override_option('style_options', array(
'name_size' => '99',
'with_weekno' => 0,
'max_items' => 0,
'max_items_behavior' => 'more',
'groupby_times' => 'hour',
'groupby_times_custom' => '',
'groupby_field' => '',
'truncated_fields' => array(),
'truncate_length' => '',
));
$handler->override_option('attachment_position', 'after');
$handler->override_option('inherit_arguments', TRUE);
$handler->override_option('inherit_exposed_filters', TRUE);
$handler->override_option('displays', array(
'calendar_1' => 'calendar_1',
'default' => 0,
'calendar_block_1' => 0,
));
$handler->override_option('calendar_type', 'day');
$handler = $view->new_display('calendar_period', 'Week view', 'calendar_period_4');
$handler->override_option('style_plugin', 'calendar_style');
$handler->override_option('style_options', array(
'name_size' => '99',
'with_weekno' => 0,
'max_items' => 0,
'max_items_behavior' => 'more',
'groupby_times' => 'hour',
'groupby_times_custom' => '',
'groupby_field' => '',
'truncated_fields' => array(),
'truncate_length' => '',
));
$handler->override_option('attachment_position', 'after');
$handler->override_option('inherit_arguments', TRUE);
$handler->override_option('inherit_exposed_filters', TRUE);
$handler->override_option('displays', array(
'calendar_1' => 'calendar_1',
'default' => 0,
'calendar_block_1' => 0,
));
$handler->override_option('calendar_type', 'week');
$handler = $view->new_display('calendar_period', 'Block view', 'calendar_period_5');
$handler->override_option('style_plugin', 'calendar_style');
$handler->override_option('style_options', array(
'display_type' => 'month',
'name_size' => '1',
));
$handler->override_option('attachment_position', 'after');
$handler->override_option('inherit_arguments', TRUE);
$handler->override_option('inherit_exposed_filters', TRUE);
$handler->override_option('displays', array(
'calendar_1' => 0,
'default' => 0,
'calendar_block_1' => 'calendar_block_1',
));
$handler->override_option('calendar_type', 'month');
$handler = $view->new_display('calendar_ical', 'iCal feed', 'calendar_ical_1');
$handler->override_option('filters', array(
'status' => array(
'operator' => '=',
'value' => 1,
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'status',
'table' => 'node',
'field' => 'status',
'relationship' => 'none',
),
'date_filter' => array(
'operator' => '>=',
'value' => array(
'value' => NULL,
'min' => NULL,
'max' => NULL,
'default_date' => 'now',
'default_to_date' => '',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'date_fields' => array(
'node.changed' => 'node.changed',
),
'granularity' => 'day',
'form_type' => 'date_select',
'default_date' => 'now',
'default_to_date' => '',
'id' => 'date_filter',
'table' => 'node',
'field' => 'date_filter',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
),
));
$handler->override_option('style_plugin', 'ical');
$handler->override_option('style_options', array(
'mission_description' => FALSE,
'description' => '',
'summary_field' => 'node_title',
'description_field' => '',
'location_field' => '',
));
$handler->override_option('row_plugin', '');
$handler->override_option('path', 'calendar/ical');
$handler->override_option('menu', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
'name' => 'navigation',
));
$handler->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
));
$handler->override_option('displays', array(
'calendar_1' => 'calendar_1',
'calendar_block_1' => 'calendar_block_1',
'block_1' => 'block_1',
'default' => 0,
));
$handler->override_option('sitename_title', FALSE);
$handler = $view->new_display('block', 'Upcoming', 'block_1');
$handler->override_option('fields', array(
'title' => array(
'label' => '',
'link_to_node' => 1,
'exclude' => 0,
'id' => 'title',
'field' => 'title',
'table' => 'node',
'relationship' => 'none',
),
'field_datetime_value2' => array(
'label' => '',
'link_to_node' => 0,
'label_type' => 'none',
'format' => 'medium',
'multiple' => array(
'group' => TRUE,
'multiple_number' => '',
'multiple_from' => '',
'multiple_reversed' => FALSE,
),
'exclude' => 0,
'id' => 'field_datetime_value2',
'table' => 'node_data_field_datetime',
'field' => 'field_datetime_value2',
'relationship' => 'none',
'override' => array(
'button' => 'Use default',
),
),
'field_location_nid' => array(
'label' => 'at',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'link_to_node' => 0,
'label_type' => 'custom',
'format' => 'default',
'multiple' => array(
'group' => 0,
'multiple_number' => '',
'multiple_from' => '',
'multiple_reversed' => 0,
),
'exclude' => 0,
'id' => 'field_location_nid',
'table' => 'node_data_field_location',
'field' => 'field_location_nid',
'relationship' => 'none',
'override' => array(
'button' => 'Use default',
),
),
));
$handler->override_option('arguments', array(
'group_nid' => array(
'default_action' => 'ignore',
'style_plugin' => 'default_summary',
'style_options' => array(),
'wildcard' => 'all',
'wildcard_substitution' => 'All',
'title' => '',
'breadcrumb' => '',
'default_argument_type' => 'fixed',
'default_argument' => '',
'validate_type' => 'none',
'validate_fail' => 'not found',
'break_phrase' => 0,
'not' => 0,
'id' => 'group_nid',
'table' => 'og_ancestry',
'field' => 'group_nid',
'validate_user_argument_type' => 'uid',
'validate_user_roles' => array(
'2' => 0,
'6' => 0,
'4' => 0,
'3' => 0,
'7' => 0,
'5' => 0,
),
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
'default_options_div_prefix' => '',
'default_argument_user' => 0,
'default_argument_fixed' => '',
'default_argument_php' => '',
'validate_argument_node_type' => array(
'blog' => 0,
'poll' => 0,
'image' => 0,
'job_posting' => 0,
'multichoice' => 0,
'quiz' => 0,
'forum' => 0,
'book' => 0,
'brand' => 0,
'chain' => 0,
'distributor' => 0,
'event' => 0,
'festival' => 0,
'importer' => 0,
'list' => 0,
'page' => 0,
'product' => 0,
'retailer' => 0,
'story' => 0,
),
'validate_argument_node_access' => 0,
'validate_argument_nid_type' => 'nid',
'validate_argument_vocabulary' => array(
'1' => 0,
'3' => 0,
'5' => 0,
'6' => 0,
'7' => 0,
'4' => 0,
),
'validate_argument_type' => 'tid',
'validate_argument_transform' => 0,
'validate_user_restrict_roles' => 0,
'validate_argument_node_flag_name' => '*relationship*',
'validate_argument_node_flag_test' => 'flaggable',
'validate_argument_node_flag_id_type' => 'id',
'validate_argument_user_flag_name' => '*relationship*',
'validate_argument_user_flag_test' => 'flaggable',
'validate_argument_user_flag_id_type' => 'id',
'image_size' => array(
'_original' => '_original',
'thumbnail' => 'thumbnail',
'preview' => 'preview',
'icon' => 'icon',
),
'validate_argument_is_member' => 0,
'validate_argument_signup_status' => 'any',
'validate_argument_signup_node_access' => 0,
'validate_argument_php' => '',
),
'date_argument' => array(
'default_action' => 'ignore',
'style_plugin' => 'default_summary',
'style_options' => array(),
'wildcard' => 'all',
'wildcard_substitution' => 'All',
'title' => '',
'breadcrumb' => '',
'default_argument_type' => 'date',
'default_argument' => '',
'validate_type' => 'none',
'validate_fail' => 'not found',
'date_fields' => array(
'node_data_field_datetime.field_datetime_value' => 'node_data_field_datetime.field_datetime_value',
),
'year_range' => '-3:+3',
'date_method' => 'OR',
'granularity' => 'month',
'id' => 'date_argument',
'table' => 'node',
'field' => 'date_argument',
'relationship' => 'none',
'default_argument_user' => 0,
'default_argument_fixed' => '',
'default_argument_php' => '',
'validate_argument_node_type' => array(
'blog' => 0,
'poll' => 0,
'image' => 0,
'job_posting' => 0,
'multichoice' => 0,
'quiz' => 0,
'forum' => 0,
'book' => 0,
'brand' => 0,
'chain' => 0,
'distributor' => 0,
'event' => 0,
'festival' => 0,
'importer' => 0,
'list' => 0,
'page' => 0,
'product' => 0,
'retailer' => 0,
'story' => 0,
),
'validate_argument_node_access' => 0,
'validate_argument_nid_type' => 'nid',
'validate_argument_vocabulary' => array(
'1' => 0,
'3' => 0,
'5' => 0,
'6' => 0,
'7' => 0,
'4' => 0,
),
'validate_argument_type' => 'tid',
'validate_argument_php' => '',
'override' => array(
'button' => 'Use default',
),
'default_options_div_prefix' => '',
'validate_argument_node_flag_name' => '*relationship*',
'validate_argument_node_flag_test' => 'flaggable',
'validate_argument_node_flag_id_type' => 'id',
'validate_argument_user_flag_name' => '*relationship*',
'validate_argument_user_flag_test' => 'flaggable',
'validate_argument_user_flag_id_type' => 'id',
'validate_argument_is_member' => 0,
'validate_user_argument_type' => 'uid',
'validate_user_roles' => array(
'2' => 0,
'6' => 0,
'4' => 0,
'3' => 0,
'7' => 0,
'5' => 0,
),
'validate_argument_transform' => 0,
'validate_user_restrict_roles' => 0,
'image_size' => array(
'_original' => '_original',
'thumbnail' => 'thumbnail',
'preview' => 'preview',
'icon' => 'icon',
),
'validate_argument_signup_status' => 'any',
'validate_argument_signup_node_access' => 0,
),
));
$handler->override_option('filters', array(
'status' => array(
'operator' => '=',
'value' => 1,
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'status',
'table' => 'node',
'field' => 'status',
'relationship' => 'none',
),
'date_filter_1' => array(
'operator' => '>',
'value' => array(
'value' => NULL,
'min' => NULL,
'max' => NULL,
'default_date' => 'now',
'default_to_date' => '',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'date_fields' => array(
'node_data_field_datetime.field_datetime_value2' => 'node_data_field_datetime.field_datetime_value2',
),
'date_method' => 'OR',
'granularity' => 'minute',
'form_type' => 'date_select',
'default_date' => 'now',
'default_to_date' => '',
'year_range' => '-3:+3',
'id' => 'date_filter_1',
'table' => 'node',
'field' => 'date_filter',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
),
));
$handler->override_option('title', 'Upcoming Events');
$handler->override_option('footer', 'Full Calendar');
$handler->override_option('items_per_page', 4);
$handler->override_option('style_plugin', 'list');
$handler->override_option('style_options', array(
'grouping' => '',
'type' => 'ul',
));
$handler->override_option('row_options', array(
'inline' => array(),
'separator' => '',
));
$handler->override_option('block_description', 'Upcoming');
$handler->override_option('block_caching', '-1');

#3

oskar_calvo - August 7, 2009 - 12:49

Hello, I have the same problem, since I update to the new versión the calendars views doesn't works.

Thanks

Oskar

#4

easp - August 13, 2009 - 14:47

Same problem also.

#5

skyredwang - August 13, 2009 - 17:05
Priority:normal» critical

change the priority to critical, since this bug prevents making changes to calendar views.

#6

borjagut - August 14, 2009 - 09:02

I've the same problem too.

#7

cglusky - August 15, 2009 - 01:30

Same error after trying to change argument from default node update to a CCK date field. Tried a few different things based on past experience:

- Date 2.3, Cal 2.2, CCK 2.5 and Views 2.6
- edited/saved each content type again with the subject CCK date field
- added cck date field to fields list (exclude from display and not)
- tried different granularity for arg
- turned on Content Permissions and granted view to anonymous for the CCK date field

None of the usual suspects seems to work to make Views happy with a CCK date field as an argument

Thanks,
C

#8

kjay - August 15, 2009 - 07:31

I was experiencing the same issue on a dev site I'm putting together. I have been tweaking against the default calendar view so I exported the view as a backup and then reverted the default calendar view using the 'revert' link in the views list.

Going back into the default calendar view and setting up again (from scratch) with argument and fields cleared this issue for me - odd

Thought this might be of help to others.

#9

ck9 - August 15, 2009 - 15:24

Also having this issue. My site is project management related and so dates are v.important and this is critical.

EDIT - Downgraded to the old version of Calendar until this is fixed (the error killed my website).

#10

ck9 - August 16, 2009 - 13:06

Can somebody please fix this. I tried the suggestion of #8 but it didn't work for me.

#11

martinjbaker - August 17, 2009 - 16:20

subscribing. same issue here.

#12

koens - August 19, 2009 - 10:05

While tracing the problem with my calendar, I ran into the error described in the issue title. I'll post my experience hoping it will help Karen in debugging the issue.

On my site I am trying to display two different content types in the day view. Let's call them foo and bar.

The content type foo has a CCK field named field_date of type Datetime. All foo nodes are displayed both in the 'Edit view calendar' preview (day view), and in the actual calendar day view page.

The content type bar has a CCK field named field_banana of type Datetime. None of the bar nodes are displayed neither in the 'Edit view calendar' preview, nor in the calendar day view page.

The view is configured so the argument Date: Date (node) takes as date field either field_date OR field_banana.

If I change the CCK field for content type bar from field_banana to (existing field) field_date, the nodes of type bar are being displayed in day view.

Upon deleting the CCK field field_date from all content types, I get the above error. Because the field_date option does not show up anymore in the 'Date field(s):' list in 'Edit view calendar', the only way to make the error disappear is by re-creating a CCK field field_date in either content type foo or bar, and re-enabling the field_date checkbox in the 'Date field(s):' list.

When I look at the preview query, I see:

SELECT ...
FROM node node
LEFT JOIN content_type_bar    node_data_field_banana ON ...
LEFT JOIN content_type_foo    node_data_field_date ON ...
WHERE ...

Executing this query directly on the database (I'm using PostgreSQL, but I don't think it matters) yields all foo and bar nodes I expect to see for a given day, so the WHERE-clause is OK, but the node_data_field_date_field_date_value column is NULL for all bar nodes.

The SQL code shows a LEFT JOIN for each content type that holds a CCK date field, but I was expecting to see a UNION somewhere to get field_banana_value in the same column as field_date_value.

Hope this hints someone in the right direction.

#13

apilasiewicz - August 19, 2009 - 12:53

subscribing

#14

Buffer2k - August 20, 2009 - 17:16

subscribe

#15

cglusky - August 21, 2009 - 14:39

OK. I browsed CVS and found where Karen made the commit that relates to this change:

http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/calendar/in...

This change came about because we needed logic to check for existence of a date field, which is a requirement of the calendar style view. See this issue for background #389294: The argument date field must also be added to View Fields or Calendar does not work

So, what I did

1) used the default calendar view
2) added the CCK date field to the "Fields" list and selected "Exclude from display" as I do not want to see it in the display
3) then changed the argument from the default of node update date to my CCK date field

The only difference appears to be the order in which I changed the default view. The key seems to be adding the CCK date field to the fields in the view **first** so we can pass the check added in the above code change.

I am not sure why you can not add the field after you get the error or even if my fix will work for anyone else.

Hope this helps,
Coby

#16

letharion - August 24, 2009 - 19:31

Thanks cglusky, that helped me.

#17

easp - August 25, 2009 - 01:16

The method in #15 did not work for me. The date field I am trying to use is a repeating date field.

#18

Mikael - August 25, 2009 - 16:27

Same problem here, could not get any of the workarounds posted here to work. Unable to use the Calendar, are there any alternatives to this calendar out there?

(subscribing and whining..)

#19

pfx75 - August 26, 2009 - 19:43

Same problem here and method in #15 did not work for me.

#20

agerson - August 26, 2009 - 21:22

Same problem.

#21

benhameh - August 28, 2009 - 00:00

Same problem.

Subscribing.

Edit: #15 solved the problem.

#22

mchevallier - August 28, 2009 - 13:03

Same problem.

Subscribing.

#23

mikeker - August 28, 2009 - 18:56

Yet another subscribe. #15 didn't work for me, rolling back to 2.1 did work.

#24

Gregory - August 29, 2009 - 22:01

This is really frustrating, subscribing to hear of a fixed version.

#25

koens - August 31, 2009 - 09:37

Forget what I said about my custom content types.
I was able to reproduce the error described in the issue title on a Drupal installation with no user defined content types, nor user defined nodes. That should somewhat reduce the playing field for the bug hunters.

Method to reproduce:
Clean install Drupal 6.13 + CCK (6.x-2.5) + Views (6.x-2.6) + Date (6.x-2.x-dev) + Calendar (6.x-2.x-dev)
RDBMS is PostgreSQL

Administer
Site building
Modules

Enable the modules:

  • Content
  • Calendar
  • Date
  • Date API
  • Date Timezone
  • Views
  • Views UI

Save configuration

Administer
Site Building
Views
calendar (Calendar) Enable
calendar (Calendar) Edit

In the Arguments section click on:
Date: Date (node) Node/updated

In the Date fields section, check/uncheck the check boxes so you get the situation:
[X] Node: Post date
[ ] Node: Updated date

Update

The Live Preview pane shows:

    * The date argument date fields must be added to this query. You can exclude them if you do not want them displayed in the calendar.
    * The date argument date fields must be added to this query. You can exclude them if you do not want them displayed in the calendar.
    * The date argument date fields must be added to this query. You can exclude them if you do not want them displayed in the calendar.
    * The date argument date fields must be added to this query. You can exclude them if you do not want them displayed in the calendar.
    * The date argument date fields must be added to this query. You can exclude them if you do not want them displayed in the calendar.

I don't understand why the error message is displayed five times nor why it is displayed only five times.

#26

arlinsandbulte - September 1, 2009 - 22:46

I am not having this issue, but seeing #25 I think I know what you are doing wrong. You are missing or forgetting a step to change the Views Field display to match the arguments setting.
Note: the error message is "The date argument date fields must be added to this query." In simpler terms, what this means is that the SAME date field you are using in the Views Arguments list must also be added to the Views Fields list.

So, in #25's example, a step is missing to update the Views Field Display:
Starting with the default Calendar View (Enable it and/or revert it)
1.) Under Arguments, click on Date: (node) Node: Updated date
2.) Under Date Fields, check/uncheck the boxes so only Node: Post Date is checked.
3.) Click Update NOTE: you now get the 5 errors as described above... THIS IS NORMAL continue on to fix...
4.) Under the Views Fields display, click the + button.
5.) Check the Node: Post date - The date the node was posted.
6.) Click Add
7.) Click Update
8.) Click Save to save the calendar view.

Errors should now go away and calendar should work as expected.

Here is the Key:

The SAME date field MUST be listed under the View's Arguments AND the View's Fields.

If you don't want to display the date field on your view, it can be excluded from display.

I KNOW this will help #25, and I hope that clears it up for everyone else too.

#27

arlinsandbulte - August 31, 2009 - 16:24

Here is a step-by-step screenshot list...

AttachmentSize
Step 1.jpg 73.54 KB
Step 2.jpg 61.96 KB
Step 3.jpg 85.43 KB
Step 4.jpg 73.82 KB
Step 5.jpg 71.04 KB
Step 6.jpg 64.56 KB
Step 7.jpg 81.08 KB
Step 8.jpg 88.35 KB

#28

bohemicus - September 1, 2009 - 22:36

Same problem, here. None of the suggestions seem to work.

#29

bohemicus - September 2, 2009 - 06:14

Actually, the solution suggested in this thread did work http://drupal.org/node/389294. It is the same as #26 but the reason I could get that to work was because the error was being displayed when editing a block display with a pager not the actual display where the field needed to be added.

#30

arlinsandbulte - September 2, 2009 - 13:04

@bohemicus: Do you mean your block display was overridden and did not contain the right fields?
That could be why other people are having issues, they did not check ALL of their displays for overridden settings and add the correct fields there too.

#31

cglusky - September 2, 2009 - 14:33

RE my steps in #15...

Yes, my CCK Date field was added to the "Defaults" view fields list so I did not need to override any of the other views to include the field. When I start tweaking a Calendar view I try to start my big changes like arguments in the Defaults view because the Year, Month, Day and Block views have Attachment settings such as Inherit Arguments etc. By starting with the Defaults view you help to make sure that the new settings are properly propagated to the other views that need the changes.

And you can see from the screenshot in #27 that step 1 is also in the Defaults view. However, there are a bunch of comments in here that are talking about core node fields and not CCK Date fields.

Please make sure if you are "subscribing" in this queue you are stating more details like whether you are using a CCK Date field and whether you are changing the Defaults view or trying to override Defaults to create another type of display like a block.

R,
C

#32

skyredwang - September 2, 2009 - 14:44
Status:active» fixed

To fix this issue, 1) delete all your date fields in the Views.Fields. 2) Add those fields back in.

#33

koens - September 3, 2009 - 11:03

Solution #26 solves the problem I have described in #25.

Maybe it's a good idea to modify the error message.

#34

bohemicus - September 5, 2009 - 07:23

@arlinsandbulte No my problem was that my default display didn't have the fields. The overridden block display did have them. My issue was that after upgrading I was getting the errors on AJAX paging in the block display which did have the field and not on paging in the default displays that didn't. So I went in, added the field, made it hidden, and that fixed it.

Here's a proposed alternative wording for the error message:

"It appears that one of your views displays is missing a date field that is also in the argument. Please add it there. If you don't want the field to show, set it to 'Exclude from display'"

#35

maerys - September 8, 2009 - 12:12

#27 worked for me. thanks :)

#36

easp - September 9, 2009 - 18:00

#27 worked for me as well. Thanks for the detailed instructions.

#37

Earl Grey - September 16, 2009 - 09:30
Status:fixed» active

This is not fixed in my opinion, as there are only work-arounds.

I got it to work only when adding the fields to the defautl view. I thought, this must be working also with fields, overriding the default view, but it does not.

So be careful: add the fields an the argument to the default view, then your calendar will work.

#38

arlinsandbulte - September 16, 2009 - 10:48
Status:active» by design

OK, maybe "fixed" was not the proper status.... but this is the way the calendar view works, so I will mark it "by design"

#39

steve42 - September 26, 2009 - 03:07

Deleted

#40

sistegraf - September 28, 2009 - 04:39

27 worked for me, thanks!

#41

arlinsandbulte - September 28, 2009 - 13:18

FYI:
I created a screencast showing how to setup the Calendar Module here: http://vimeo.com/6544779

I also created a followup on how to setup an Upcoming Events list using Calendar here: http://vimeo.com/6547042

#42

N1ckhead - October 6, 2009 - 21:16

#27 works! - Just make sure you pick the appropriate Field for the Argument you're using. For example...

I took this tutorial regarding Date, Calendar, and Views -> http://www.drupaltherapy.com/node/76 - When I was done completing the steps to setup the calendar view, I received the "The date argument date fields..." error. Why didn't the dude in the tutorial get the error?

Anyway, this Argument -> "Date: Date (node) Content: Date (field_date) - From date " wouldn't work without this Field -> "Content: Date - From date Default ".

You can set the "extra" field as hidden if you like. It's likely you'd want to hide it, otherwise, you wouldn't have received the error in the first place :)

See screenshot for view configuration.

AttachmentSize
CalendarViewWorking.jpg 111.87 KB

#43

work77 - October 15, 2009 - 19:13

Thanks. That image in #42 made me realize the error of my ways.

When selecting a new field from the drop-down, I was choosing Node (because the argument reads Node), but you're supposed to select Content. Then,
"Content: Date - From date Default".

I learned something :)

Thanks.

#44

js - October 19, 2009 - 18:25

I have tried all of the suggestions above, but I can't get the calendar to work when using CCK fields. I get the errors about how it will not work without a Date argument when I delete the "Node: Updated date Updated date" from Arguments.

Errors like "The Calendar display 'Calendar page' will not work without a Date argument."

I have tried just changing the default and also just changing the Calendar page and the Calendar block (which is the view I require).

I have the CCK field:
Date: Date (node) Content: Date (field_date) - From date

I have disabled and re-enabled the Calendar and Date modules. I un-installed Calendar. I was concerned about losing data so I did not un-install the date field..

I added the field to the "Fields" and "Arguments". I have tried in every order of steps I could think of including removing "Node: Updated date" before and after adding the CCK field. I have tried leaving "Node: Updated date" in the Fields and also without. I have reverted the default Calendar view and I have tried cloning the Calendar view after re-installing the module.

I have tried using Views 6.x-3.x-dev (2009-Oct-08) as well.

I would really appreciate any suggestions. All this guessing devours time as many of you know.

Thanks, Jerry

#45

js - October 19, 2009 - 20:17

I did get this to work. I have no idea what magic words I spoke, or sequence of events, but after un-installing Calendar and Views again I was able to get this to work. I wish I had kept track of the exact steps better to hopefully help someone else because this can be so painful. I am sure I added the CCK field to the field list and to the Arguments before deleting the Node: Update date from the Arguments. My wild guess is that it is more to do with re-installing Views and Calendar together--just guessing.

Jerry

#46

morthylla - November 4, 2009 - 17:28

#26, thank you!!! It worked, thank you very much.

#47

developer-x - November 5, 2009 - 07:16

Posting #15 did the trick for me - but we should get a patch to make this whole thing a non-issue, no? The argument and field were the same, but apparently if I add the argument then the field, it breaks. If I add the field, then the argument it works. This is a bug, no?

#48

aldass - November 6, 2009 - 04:22

For #27... it worked perfectly... much thanks.

#50

J0nathan - November 12, 2009 - 15:23

#15 worked for me
Thank you

#51

corbin - November 26, 2009 - 10:41

5.) i first try checking "Node: Post date - The date the node was posted."
it didn't work.

but i checked (also) "Updated/commented date" and it's ok

explanation of a funny procedure :
first, it didn't work.
as i am french, i had to be sure of the translation to check the right field ... and i search 'The date the node" in the translation search.
and found of course "The date the node was updated", but also "The date the node was last updated" : it is only a comment under the line "Updated/commented date" !

#52

geomarketing - November 27, 2009 - 17:40

I don't think you want the post date, this worked for me but I put in the "date from" on my Event content type not the date posted.

But thanks I am good to go now.

#53

izmeez - November 29, 2009 - 20:46

subscribe

#54

AdrianB - December 10, 2009 - 00:53

#15 worked for me as well, and when I read it I realized how logical it was. You have to add the field to use it for argument, it's quite simple.

But I didn't understand the error message before I read #15, even though I understand it now. If it is possible to somehow change the error massage to be just a little more understandable I think it would help others as well.

#55

anewbie - December 20, 2009 - 12:52

I met the same problem too but now problem solved.

When I create a new view for my calendar, I hit the problem and missing "Style: Calendar navigation" in the view.

Instead I tried to use the default view which had already been there:
Default Node view: calendar (Calendar)
then everything worked, including no more "The date argument date fields must be added to this query. You can exclude them if you do not want them " message. Everything seemed to be just exactly like those demo videos.

Hope this can help.

 
 

Drupal is a registered trademark of Dries Buytaert.