civicrm 2.2.7
drupal 6.13
calendar 6.x-2.1

using the new civicrm event driven calendar view

disabled the old calendar view that pulls events from drupal nodes

enabled the one that comes with the latest version of calendar module
it allows one to view events in civicrm instead of drupal nodes

applied patch to date_api_fields per http://civicrm.org/node/557

almost everything works correctly.

the correct civicrm fields appear in the calendar view, except that the popup displays information from a drupal node with the same # as the intended civicrm event

http://www-new.familieslikeours.org/calendar2 - it's the event on July 30th and 31st.

I have cleared the 'views cache' to no avail so I'm guessing the popup needs a patch.

Comments

site_issues’s picture

Title: calendar popup retrieves wrong civicrm event info » calendar popup retrieves wrong event info
lunk rat’s picture

I see this behavior as well. Very frustrating! Have you fixed it?

This problem is only with the popup: if you hover the link, it shows that it points to the event page. If you right-click the link and "Open link in new tab" it brings you to the event page.

But when you click the link it shows a jquery popup with the wrong info :(

choster’s picture

CiviCRM Event URLs are provided as, for instance, www.example.org/civicrm/event/info?reset=1&id=25 . The popup script, however, retrieves information as if it were www.example.org/node/25 .

Indeed, line 3 of jscalendar.js indicates that the script assumes all calendar data are nodes, and hunts for nids. CiviCRM Events are not nodes, however. I suspect if user profile fields could be induced to display in the calendar, it would misinterpret uids as nids as well.

This would not affect sites using FeedAPI to import the CiviCRM feed a la http://wiki.civicrm.org/confluence/display/CRMDOC/Using+Drupal+Calendar+... . Interestingly, I can't find any issues about it at the CiviCRM forums.

choster’s picture

Title: calendar popup retrieves wrong event info » calendar popup retrieves node data even if calendar item is not a node
Version: 6.x-2.1 » 6.x-2.x-dev
Category: bug » task

Digging a little bit more, line 48 of jcalendar.js retrieves the node information based on the id of the parent, but the CiviCRM event integration handlers output civicrm_event ids as if they were node ids, e.g. the container div

<div class="calendar monthview" id="calendar:16:start_date:0:0">

and thus the popup loads "node" 16.

Calendar as a whole is preconfigured to load nodes, something that cannot be changed in the Views UI, so I don't think jcalendar.js as written is being unreasonable. And since it can't be expected to know how to find the right fields to display for non-native content, this probably falls back on the CiviEvent side to provide an alternative module.

robertjd’s picture

Subscribe. Does anyone here know if a thread has been started on the CiviCRM forum about this? I see a few posts mentioning that this problem exists, but not one devoted to the issue.

choster’s picture

There's http://forum.civicrm.org/index.php/topic,8695.0.html , which is not much of a workaround, if you want to revive it.

Again, IMVHO I don't think jCalendar popup is doing anything "wrong," it's that the contributed integration (based largely on one user's code) does not extend to the jCalendar component, so you're more likely to find a solution (or direction in order to code your own solution) over at Civi.

cjd400’s picture

subscribe

berdley’s picture

Since the problem is ONLY with the jquery pop-up calendar, the simple solution is to turn off the calendar pop-ups and make the event link load a new page.

arlinsandbulte’s picture

Status: Active » Closed (won't fix)

This issue is pretty old & #8 provides a work around. And from the conversation, it might not even be an issue with Calendar at all.
Feel free to re-open if you think this is still valid.

Thus0’s picture

For a quick and dirty workaround, I've modified jcalendar.js (/sites/all/modules/calendar/jcalendar) so it gets the right information from CiviCRM Event :

replace line :

url: Drupal.settings.basePath + "?q=jcalendar/getnode/"+nid+"/"+ids,

by this line :

url: Drupal.settings.basePath + "?q=civicrm/event/info&html=1&snippet=1&id="+nid,