Closed (fixed)
Project:
Calendar
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Nov 2007 at 23:58 UTC
Updated:
15 Feb 2008 at 10:41 UTC
My calendar table doesn't appear when I add an event for the last day of the month. The weird thing is that if I have any other events scheduled in the same month, the calendar appears, but the last day's event doesn't show up in the calendar. So, for instance, I have an event scheduled for Nov. 30 and another one scheduled for Nov. 25, but the Nov. 30 event doesn't show up. If I delete the Nov. 25 event, the calendar table disappears altogether. I'm using a cck type with a date field for the events. Any ideas?
Here's the view:
$view = new stdClass();
$view->name = 'event_calendar';
$view->description = 'Calendar view of any date field, add a date field to the view to use it.';
$view->access = array (
);
$view->view_args_php = '';
$view->page = TRUE;
$view->page_title = 'Calendar';
$view->page_header = '';
$view->page_header_format = '1';
$view->page_footer = '';
$view->page_footer_format = '1';
$view->page_empty = '';
$view->page_empty_format = '1';
$view->page_type = 'calendar';
$view->url = 'calendar';
$view->use_pager = FALSE;
$view->nodes_per_page = '0';
$view->block = TRUE;
$view->block_title = 'Calendar';
$view->block_header = '';
$view->block_header_format = '1';
$view->block_footer = '';
$view->block_footer_format = '1';
$view->block_empty = '';
$view->block_empty_format = '1';
$view->block_type = 'calendar';
$view->nodes_per_block = '999';
$view->block_more = TRUE;
$view->block_use_page_header = FALSE;
$view->block_use_page_footer = FALSE;
$view->block_use_page_empty = FALSE;
$view->sort = array (
array (
'tablename' => 'node_data_field_event_date',
'field' => 'field_event_date_value',
'sortorder' => 'ASC',
'options' => '',
),
);
$view->argument = array (
array (
'type' => 'calendar_year',
'argdefault' => '2',
'title' => '%1',
'options' => '',
'wildcard' => '',
'wildcard_substitution' => '',
),
array (
'type' => 'calendar_month',
'argdefault' => '2',
'title' => '%2',
'options' => '',
'wildcard' => '',
'wildcard_substitution' => '',
),
array (
'type' => 'calendar_day',
'argdefault' => '2',
'title' => '%3',
'options' => '',
'wildcard' => '',
'wildcard_substitution' => '',
),
);
$view->field = array (
array (
'tablename' => 'node',
'field' => 'title',
'label' => 'Title:',
'handler' => 'views_handler_field_nodelink',
'options' => 'link',
),
array (
'tablename' => 'node_data_field_event_date',
'field' => 'field_event_date_value',
'label' => '',
'handler' => 'content_views_field_handler_ungroup',
'options' => 'default',
),
);
$view->filter = array (
array (
'tablename' => 'node',
'field' => 'status',
'operator' => '=',
'options' => '',
'value' => '1',
),
array (
'tablename' => 'node',
'field' => 'type',
'operator' => 'OR',
'options' => '',
'value' => array (
0 => 'calendar_event',
),
),
array (
'tablename' => 'node_data_field_event_date',
'field' => 'field_event_date_value_default',
'operator' => '>=',
'options' => '',
'value' => 'now',
),
);
$view->exposed_filter = array (
);
$view->requires = array(node_data_field_event_date, node);
$views[$view->name] = $view;
Here's the cck type:
$content[type] = array (
'name' => 'Calendar Event',
'type' => 'calendar_event',
'description' => 'An event that will be displayed in the event calendar.',
'title_label' => 'Title',
'body_label' => 'Body',
'min_word_count' => '0',
'help' => '',
'node_options' =>
array (
'status' => true,
'promote' => false,
'sticky' => false,
'revision' => false,
),
'comment' => '0',
'old_type' => 'calendar_event',
'orig_type' => '',
'module' => 'node',
'custom' => '1',
'modified' => '1',
'locked' => '0',
);
$content[fields] = array (
0 =>
array (
'widget_type' => 'date_select',
'label' => 'event_date',
'weight' => '-4',
'select_day' => '1',
'select_month' => '1',
'select_year' => '1',
'years_back' => '3',
'years_forward' => '3',
'increment' => '1',
'description' => '',
'required' => '1',
'multiple' => '0',
'granularity' =>
array (
'Y' => 'Y',
'M' => 'M',
'D' => 'D',
'H' => 'H',
'N' => 'N',
),
'todate' => 'optional',
'input_format' => 'site-wide',
'input_format_custom' => '',
'output_format_date' => 'm/d/Y - g:ia',
'output_format_zone' => '',
'output_format_custom' => '',
'output_format_date_long' => 'l, F j, Y - g:ia',
'output_format_zone_long' => '',
'output_format_custom_long' => '',
'output_format_date_medium' => 'D, m/d/Y - g:ia',
'output_format_zone_medium' => '',
'output_format_custom_medium' => '',
'output_format_date_short' => 'm/d/Y - g:ia',
'output_format_zone_short' => '',
'output_format_custom_short' => '',
'tz_handling' => 'site',
'field_timezone' => 'US/Eastern',
'field_name' => 'field_event_date',
'field_type' => 'date',
'module' => 'date',
),
);
Comments
Comment #1
eeyorrSome more info: The table does actually appear, but there are no rows -- just an empty tbody. This isn't a problem in the year view - only the single month view, including the sidebar mini calendar.
Comment #2
zetxek commentedI've had this problem too.
I "solved" it by adding an event to the empty month, that way the month showed up. Then, I could delete that event and I would keep on seeing the month, although it was empty...
Weird anyway.
Comment #3
eeyorrThanks for the reply, but that's not the same problem I have. My problem is that the month disappears when I add an event to the last day of the month.
Comment #4
zetxek commentedOh, sorry, I understood it wrongly. I'll open a new ticket.
Comment #5
KiberGus-1 commentedI think I have the same problem on my site too. Some months dissappear and nodes, which are arranged for the last day of a month are missed.
Comment #6
KiberGus-1 commentedLook at calendar_get_calendar in calendar_api.inc.
Before these lines dates are correct
and after them start date is greater, than end date. If I comment these lines, tables and events don't dissappear.
But I still don't know, what these lines are needed for. So further investigation is needed.
Comment #7
KiberGus-1 commentedI thik, that the bug occurs because calendar module incorrectly deals with timezones. I partially solved problem by using calendar_event_date instead of date_format_date. It looks not only at dates's timezone, but also at users timezone and site timezone.
As a result I got correct start and end time for events. Ther is still at least one more bug, if event is in previous month in local time, but at current month for user time, is is dropped somewhere (I think it is dropped by SQL query).
As for dissappearing tables... I think they dissappear when there is an event (so empty table is not drawn), but this event because of time zone handling appears in another month.
Comment #8
karens commentedI just committed some changes to the way the min and max dates are computed, so see if that fixes your problem.
Comment #9
eeyorrNo, that didn't solve it. It also disappears when the current date is the last day of the month. Thanks, KiberGus and KarenS for all your help.
Comment #10
karens commentedMake sure you got the latest fixes. The only way you would have gotten them yesterday was if you got your code directly from cvs. If you use the tarball, it wouldn't have the fixes until today. And of course you need the development version rather than the last official release.
Can you confirm that you had the latest code and still had the problem?
Comment #11
eeyorrI tried again this morning with the latest development version and it's still not working.
Comment #12
Kreba commentedI have about the same problem. With my calendar events for 31-1-2008 and 31-3-2008 were missing. I've just updated the described fixes. Now I can see the event for 31-1-2008 but I still can't see the event for 31-3-2008. And a new problem for 1-2008 and 2-2008 came up: I now can see both months in one view only.
Comment #13
KiberGus-1 commented2 Kerba: I described only partial fix. It covers only some of the issues. For example if you have in issue for 31 and your timezone moves it to 1st of next month it would be lost because SQL query wouldn't select it.
I am afraid, that the problem is quite serious, bacause fixing it would mean modifiend time handling in all module. So it is big peace of work. Changes in calendar_get_calendar only gave me normal workflow for most part of events, but this is far from final solution.
Comment #14
Kreba commentedthe problem is solved by the use of the new version of the Date-Modul (5.x-1.8) http://drupal.org/project/date
Thanks for the sopport and i wish you a happy new Year
Comment #15
karens commentedComment #16
Eugene Fidelin commentedI install the new version of the Date-Modul (5.x-1.8) but this trouble is not solved.
Comment #17
karens commentedThis should definitely be solved in the latest dev version (5.x-2.x-dev). It requires the 5.x-2.x version of the Date module with its improved date and timezone handling.
Comment #18
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.