i'm trying to display nodes in my calendar by the cck date field in that node.
the nodes are currently being displayed on the node creation date.
when i try to change that or add a filter in the calendar view, the javascript popup "an error has occurred" happens.

is this a bug or is this just something i'm doing wrong in the calendar view?

thanks for the help...

Comments

KarenS’s picture

Status: Active » Postponed (maintainer needs more info)

Hm, it was working but I've been tweaking things and maybe I broke something. You should definitely be able to select CCK date fields there.

Make sure you have the very latest Date and Calendar -dev code since there have been recent commits and see if you still have problems. If so, I'll have to do more investigation.

Daga’s picture

Status: Postponed (maintainer needs more info) » Active

Think I found the problem for you... it is in calendar.inc. Two bugs:

1. Line 261 (slightly unrelated, but still dealing with dates) tries to use "date_format" instead of "custom_date_format" (ie: it just checked if "date_format" was "custom").

2. Lines 319 - 323 remove the date after it has been created. Commenting these out fixed the calendar for what I was wanting to use it for.

EDIT: After re-reading, maybe this isn't the same problem mentioned but I'm not completely sure since I haven't installed CCK. Let me know if I need to open my own bug report.

chadd’s picture

i tried installing the newest dev versions of both cal and date and then the following error occurs on every page:
Fatal error: Call to a member function on a non-object in /htdocs/sites/all/modules/views/includes/view.inc on line 378
so i went to back to the beta version

RusRabbit’s picture

The same things happen with me!
I want to set up the calendar of future events on my site, but still haven't been able to get it work. I tried all possible combinations of beta- and dev- versions of Views, Date and Calendar modules.

Ended up with Views beta 3, Date 6.x-2.0-beta and the latest dev version of Calendar module, and get all the errors described above in the topic.

chadd’s picture

i noticed that even tho the javascript popup 'an error has occured' displays, the argument/filter gets inserted anyways, so i added the cck date field as a filter to my calendar view, but then i had an error of:
call to undefined function granularity_keys() in date/date/date.views.inc on line 1212

i commented out that line, and that got rid of the error, but now nothing shows up in my calendar.
i removed that filter and it went back to displaying the node on the day it was created (not on the cck date)

i tried the same method with the argument. added it, ignoring the popup error, and now the argument is there, but it is set to Argument format: YYYY-MM-DD and i think i need it to Argument format: now-now-now (?) but i can't edit it because of the javascript ajax error when i click on it.
it says "an error has occured in the popup, but this is the console message from FF web dev plugin, if it helps:

Fatal error: Cannot unset string offsets in /htdocs/sites/all/modules/date/date/date.views.inc on line 1237

tried finding where the views argument is stored in the database but no luck (with drupal 5 it was in views_arguments table, but that seems to be gone now with d6).

any help on any of this?

chadd’s picture

ok, i think i got this working.
it took quite a bit of monkeying around, but i'll try to explain it all here, and i hope i don't miss a step.

the javascript 'an error has occured' errors seemed to be coming from timezone problems, so i commented out lines 918. 919, and 920 in date/date/date.views.inc

in date/date_api_sql.inc i did the following:
- comment out lines 184-192, and line 153. 154, 155
- remove the extra T in line 157 so the time format looks like: '%Y-%m-%%d %T'

i saw there was a similar sql error in this bug: http://drupal.org/node/262556
so i followed his 'fix' and in views/includes/query.inc i found the add_field function on line 576 and added this to the first line of the function:

  // make sure field isn't empty
  if (empty($field)) return;
  

finally, in your view UI in the admin, change the Calendar: Date argument to use your node's CCK date field, whatever you happened to name that, instead of the node changed date.

after all that, it seems to be displaying correctly with the node displaying in the calendar on the date in the cck date field, instead of the date it was created/updated.

i hope i remembered all the changes i made, and i have no idea if these changes will break other things, so the normal disclaimers apply (make sure to backup your db and files before trying this stuff) but they got my site working how i needed it.

hope this helps someone...

KarenS’s picture

Status: Active » Fixed

I just released a new 6.2-beta2 version for both Calendar and Date, so update to the latest code for both modules. There is documentation for the way the Calendar now works on the Calendar project page.

If you still have problems after that, open a new issue marked with the beta2 version so I know it's still a problem there.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.