Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have a CCK type with only the date field added. CCK is version 1.3. Using views (1.5) under drupal 5.1 I am unable to create a calendar (1.2) that does not contain a date in each calendar box. When I go back to 1.0 beta, this behavior goes away. When creating the view, I use the node title and date field and the standard year, month, and day arguments along with a filter for my CCK calendar type.
http://teachernotes.org/drup2/?q=cal/2007/2
Comment | File | Size | Author |
---|---|---|---|
#31 | screen_6.png | 5.19 KB | harriska2 |
#3 | content_type1.png | 4.5 KB | harriska2 |
Comments
Comment #1
gmak CreditAttribution: gmak commentedI'm getting the same behaviour. You can see this at: http://portal.baade.org/calendar.
I can't see what is generating this date, as it is not a field that is called for in the setup for the view.
using:
calendar module 1.20.2.16
views module 1.166.2.6
Comment #2
KarenS CreditAttribution: KarenS commentedI need to add this to the instructions at the top of the issue page, but I almost always need to see and export of your view to debug things like this.
Comment #3
harriska2 CreditAttribution: harriska2 commented$view = new stdClass();
$view->name = 'Cal';
$view->description = '';
$view->access = array (
);
$view->view_args_php = '';
$view->page = TRUE;
$view->page_title = 'Cal';
$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 = 'cal';
$view->use_pager = TRUE;
$view->nodes_per_page = '10';
$view->menu = TRUE;
$view->menu_title = 'Cal';
$view->menu_tab = FALSE;
$view->menu_tab_default = FALSE;
$view->menu_tab_weight = '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' => '',
'handler' => 'views_handler_field_nodelink',
'options' => 'link',
),
array (
'tablename' => 'node_data_field_cal',
'field' => 'field_cal_value',
'label' => '',
'handler' => 'content_views_field_handler_group',
'options' => 'default',
),
);
$view->filter = array (
array (
'tablename' => 'node',
'field' => 'type',
'operator' => 'OR',
'options' => '',
'value' => array (
0 => 'cal',
),
),
);
$view->exposed_filter = array (
);
$view->requires = array(node, node_data_field_cal);
$views[$view->name] = $view;
Comment #4
harriska2 CreditAttribution: harriska2 commented$content[type] = array (
'name' => 'Cal',
'type' => 'cal',
'description' => '',
'title_label' => 'Title',
'body_label' => '',
'min_word_count' => '0',
'help' => '',
'node_options' =>
array (
'status' => true,
'promote' => true,
'sticky' => false,
'revision' => false,
),
'comment' => '2',
'old_type' => 'cal',
'orig_type' => '',
'module' => 'node',
'custom' => '1',
'modified' => '1',
'locked' => '0',
);
$content[fields] = array (
0 =>
array (
'widget_type' => 'date_select',
'label' => 'Cal',
'weight' => '0',
'select_day' => '1',
'select_month' => '1',
'select_year' => '1',
'years_back' => '3',
'years_forward' => '3',
'increment' => '1',
'description' => '',
'group' => false,
'required' => '0',
'multiple' => '0',
'granularity' =>
array (
'Y' => 'Y',
'M' => 'M',
'D' => 'D',
),
'todate' => '',
'input_format' => 'site-wide',
'input_format_custom' => '',
'output_format_date' => 'm/d/Y - H:i',
'output_format_zone' => '',
'output_format_custom' => '',
'output_format_date_long' => 'l, F j, Y - H:i',
'output_format_zone_long' => '',
'output_format_custom_long' => '',
'output_format_date_medium' => 'D, m/d/Y - H:i',
'output_format_zone_medium' => '',
'output_format_custom_medium' => '',
'output_format_date_short' => 'm/d/Y - H:i',
'output_format_zone_short' => '',
'output_format_custom_short' => '',
'tz_handling' => 'site',
'field_timezone' => 'GMT',
'field_name' => 'field_cal',
'field_type' => 'date',
'module' => 'date',
),
);
Comment #5
KarenS CreditAttribution: KarenS commentedFound the problem. There was a varible that wasn't getting reset properly so it was carrying over a previous (invalid) value. This one probably caused some of the other errors on the issue queue, too, so it was a real problem. The provided view and field info was critical to helping me find it, so thanks!
Comment #6
harriska2 CreditAttribution: harriska2 commentedKaren, thanks. I went to CVS and got version 1.20.2.19 of the calendar.module for 5.x. I updated, added some more test data to http://teachernotes.org/drup2/?q=cal
Just wondering, is the date supposed to show within the calendar?
Calendar view
$view = new stdClass();
$view->name = 'Cal';
$view->description = '';
$view->access = array (
);
$view->view_args_php = '';
$view->page = TRUE;
$view->page_title = 'Cal';
$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 = 'cal';
$view->use_pager = TRUE;
$view->nodes_per_page = '10';
$view->menu = TRUE;
$view->menu_title = 'Cal';
$view->menu_tab = FALSE;
$view->menu_tab_default = FALSE;
$view->menu_tab_weight = '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' => 'node_data_field_cal',
'field' => 'field_cal_value',
'label' => '',
'handler' => 'content_views_field_handler_ungroup',
'options' => 'default',
),
);
$view->filter = array (
array (
'tablename' => 'node',
'field' => 'type',
'operator' => 'OR',
'options' => '',
'value' => array (
0 => 'cal',
),
),
);
$view->exposed_filter = array (
);
$view->requires = array(node, node_data_field_cal);
$views[$view->name] = $view;
CCK date field
$content[type] = array (
'name' => 'Cal',
'type' => 'cal',
'description' => '',
'title_label' => 'Title',
'body_label' => '',
'min_word_count' => '0',
'help' => '',
'node_options' =>
array (
'status' => true,
'promote' => true,
'sticky' => false,
'revision' => false,
),
'comment' => '2',
'old_type' => 'cal',
'orig_type' => '',
'module' => 'node',
'custom' => '1',
'modified' => '1',
'locked' => '0',
);
$content[fields] = array (
0 =>
array (
'widget_type' => 'date_select',
'label' => 'Cal',
'weight' => '0',
'select_day' => '1',
'select_month' => '1',
'select_year' => '1',
'years_back' => '3',
'years_forward' => '3',
'increment' => '1',
'description' => '',
'group' => false,
'required' => '0',
'multiple' => '0',
'granularity' =>
array (
'Y' => 'Y',
'M' => 'M',
'D' => 'D',
),
'todate' => '',
'input_format' => 'site-wide',
'input_format_custom' => '',
'output_format_date' => 'm/d/Y - H:i',
'output_format_zone' => '',
'output_format_custom' => '',
'output_format_date_long' => 'l, F j, Y - H:i',
'output_format_zone_long' => '',
'output_format_custom_long' => '',
'output_format_date_medium' => 'D, m/d/Y - H:i',
'output_format_zone_medium' => '',
'output_format_custom_medium' => '',
'output_format_date_short' => 'm/d/Y - H:i',
'output_format_zone_short' => '',
'output_format_custom_short' => '',
'tz_handling' => 'site',
'field_timezone' => 'GMT',
'field_name' => 'field_cal',
'field_type' => 'date',
'module' => 'date',
),
);
Comment #7
harriska2 CreditAttribution: harriska2 commentedI went ahead and rolled back to 1.2 dated 11/19/06 and it seems to work pretty well. I did a diff between the version on 11/19 and 1/12 and can't figure out why the older (11/19) version doesn't display the date and the newer version (1/12) does.
Comment #8
gmak CreditAttribution: gmak commentedThis issue still persists in HEAD. In the month, week and day views you see the fields selected in the View settings for calendar but you also see an additional 'end date'.
Comment #9
gmak CreditAttribution: gmak commentedchanging to active, based on previous post
Comment #10
Lowell CreditAttribution: Lowell commentedIs there a version of calender that is newer than the 2/1/2007 version 1.2?
I am having the same trouble and wonder if the fix is in a newer version that I just don't know how to access
Comment #11
harriska2 CreditAttribution: harriska2 commentedYes, in the repository Karen submitted one that is 3 days old (calendar.module file). It is here:
http://cvs.drupal.org/viewcvs/drupal/contributions/modules/calendar/cale...
1. Click on download and save the file
2. Back up your old calendar.module file under modules/calendar (name it something like calendar.module.old or something)
3. Replace the calendar.module with the new one
4. Go to admin -> modules and click on update database
Comment #12
gmak CreditAttribution: gmak commentedthe process described by harriska2 doesn't seem to result in anything new. I'm still getting the extra dates (end date) appearing in the calendar views
Comment #13
gmak CreditAttribution: gmak commentedActually, I've just noticed that following harriska2's process fixes this issue but doesn't change the 'rogue end date' in the view.
Comment #14
gmak CreditAttribution: gmak commentedMore digging and testing and I find that with the latest CVS version of Calendar and the latest HEAD on date module I'm getting:
rogue end date still appearing in Month view
no rogue end date in week view, but week view also does not show all of the fields defined for the view.
View definition:
CCK definition:
Comment #15
harriska2 CreditAttribution: harriska2 commentedGMAC - Nice putting your code between code tags. Yes, I agree it is not fixing the problem of putting in dates for a calendar (which seems redundant and is a newer issue as it didn't do that before.)
I suspect Karen has a full time job and can work on this once every week or so - she is a volunteer, anyways. I hate to bug her and wish I was a better coder to figure it out. The only diff I see between the older somewhat working code (from November) and the newer code is that the new code uses more arrays. My weakness in PHP :(
Comment #16
gmak CreditAttribution: gmak commentedharriska2,
I certainly don't want anyone to think that by posting here I'm bugging KarenS for a quick response. I can't begin to explain how much I appreciate the work of KarenS and all of the others who give of their time and expertise in developing Drupal and all the modules that we rely on. I hope that by posting, and updating issues, we are helping to further the development.
I wish I had more time and experience with PHP so that I could do more than be 'tester'. If we all do what we can, I hope that we'll be able to help make Drupal and the modules more robust for all.
Comment #17
KarenS CreditAttribution: KarenS commentedI've made a number of fixes to the date module, which is at least partly responsible for things mentioned in this issue, so please get the very latest cvs versions of both date and calendar modules and see how that affects things.
If you are still have problems after that, please report back exactly what you are not seeing that you expect to see (or vice versa) since the thread has gotten very confused and I'm not completely sure I understand which questions remain.
Comment #18
KarenS CreditAttribution: KarenS commentedOops, I see we have some event dates in here too, so I need to take a look at the Event Views module as well. I thought it was mostly date module dates that were problems. Anyway, I've gotten a number of fixes made to the date module that needed to be done before making any changes here, so my next project is to start through the calendar issue queue. Hopefully I'll be able to get some of these issues resolved fairly soon.
And no problem about bugging me, as long as everyone understands that I can't always get to them right away, posting as many details about your issues as possible is helpful when I get ready to work on them.
Comment #19
Lowell CreditAttribution: Lowell commentedSome Feedback for KarenS
I just applied the lastest CVS for date.inc and date.module for Drupal 5
Let me know what code to show if you need it, these sound like similar issues as above
One additional thing that might be related and I haven't seen it posted anywhere yet. Might be only my installation. The week view has links for previous week and next week that were referencing the viewed week and two weeks from now respectively. I changed the following code in the calendar.module and it seems to work correctly for me now.
I hope this is info that you can use, and with a little help I will post any other required code or settings, etc.
Comment #20
gmak CreditAttribution: gmak commentedwith latest CVS for Date (including date.inc) and Calendar, the extra date field (in my case it's always the end date) is still appearing.
Comment #21
Lowell CreditAttribution: Lowell commentedKarenS
I was not able to add a node until after removing the latest CVS for date.module and .inc
It was a CCK content type with a date field that return an error claiming an invalid from date
again, let me know if there is something specific I can show you or troubleshoot myself to help out
Comment #22
Lowell CreditAttribution: Lowell commentedOne more note here about date, then I'm going to look in the date issues for a fix
I had the to date setting as optional, now it is forcing a Jan 1, 2007 date and the new items don't show up on the calendar at all
wish me luck
Comment #23
Lowell CreditAttribution: Lowell commentedeeek, it might not be from the date updates, it is still doing it, and since I haven't added any of this content type in a while, I don't know where to begin to look for a solution
Comment #24
KarenS CreditAttribution: KarenS commentedLowell, where are you finding that a January 1, 1970 date is forced? If it's on a CCK date field, please export the date field so I can see how it is set up.
Comment #25
Lowell CreditAttribution: Lowell commentedThis seems to be working now, Thanks
Comment #26
gmak CreditAttribution: gmak commentedI'm sorry to re-open this, but I'm still getting an extra end date field showing up in the monthly calendar view and the day view. You can see this here for month and here for day you can also see that its not happening in the week view.
I'm using the lates CVS versions for Date and Calendar.
I've removed any template functions that might have been effecting the output in the calendar.
Here's the view export for Calendar:
Comment #27
harriska2 CreditAttribution: harriska2 commentedSame here. I updated date, CCK, and calendar to the newest version as of 2/22. I was going to post my exports but this issues is not marked fixed so I thought Karen was still working on it. It is a minor nit pick but the boxes for each day are so small and the date uses up lots of room :(
Comment #28
Lowell CreditAttribution: Lowell commentedThis might help a little
I compared your view export with mine and I also compared your calendar test page with mine and it looks like you are referring to the date output on the same line as your test message. If this is the case then it looks to me that the following code might be the culprit
Go to your view setings and see if you are asking it to include the node body. This is where I was able to add and remove content from my calendar output.
gluck
Comment #29
KarenS CreditAttribution: KarenS commentedYes that is the answer -- I missed it but you included the body as a field and the body is going to display the date again after the calendar module has already displayed it. You can fix this either by omitting the body from your view or if you really want to see the body instead of the date the calendar module creates, add the appropriate theme from calendar.theme to your phptemplate and comment out the places where the calendar module is inserting dates.
I think that is the solution you need, so I'm marking this fixed, but you can reopen if not.
Comment #30
harriska2 CreditAttribution: harriska2 commentedHmm, that didn't seem to do it for me. I have all new patches for date & API (1.3 dated 2/22) and calendar (1.3 dated 2/22) and the newest CCK (1.3 dated 2/01) installed on 5.1. It still includes the date. In the view, I did not include the body.
View export:
And the export of the CCK type:
Comment #31
harriska2 CreditAttribution: harriska2 commentedAttached is a screenshot
Comment #32
KarenS CreditAttribution: KarenS commentedThe date module will display the title and date by default. That is by design. If you don't want to see *any* date in the calendar, add the appropriate theme from calendar.theme to your phptemplate and comment out the places where the calendar module is inserting dates.
Comment #33
KarenS CreditAttribution: KarenS commentedJust to explain further, I can see that there are times when you won't want to see the dates, but since this module is designed to work with all kinds of date fields there are also times when you will want to see the dates, so that's why for now at least I'm just proposing you handle this with themeing if you don't like the default. There may be niftier ways to do it in the future, but my focus right now is getting basic functionality working and that is taking all the time I have for this project.
Comment #34
harriska2 CreditAttribution: harriska2 commentedI went ahead and remmed out all the references to $node->calendar_start and end in the calendar.theme file. Worked like a charm for the day, week, and month view.
Thanks a ton.
Comment #35
(not verified) CreditAttribution: commented