CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Integrating CiviEvents with Drupal Calendar
Pages: 1 2 [3] 4

Author Topic: Integrating CiviEvents with Drupal Calendar  (Read 56996 times)

bcobin

  • I post frequently
  • ***
  • Posts: 337
  • Karma: 9
    • InterCreative Media
  • CiviCRM version: 4.3.3
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.9
  • PHP version: 5.3
Re: Integrating CiviEvents with Drupal Calendar
June 02, 2012, 01:17:08 pm
Has anyone seen this yet?

http://drupal.org/node/1595246

In short, trying to create a calendar using views integration causes:

Fatal error: Class 'calendar_plugin_row_node' not found in /sites/all/modules/civicrm/drupal/modules/views/plugins/calendar_plugin_row_civicrm.inc on line 25

From the Calendar developer on 5/22/12:

Quote
I added a warning a couple releases ago that that class was going away and should not be used. CivicCRM should be using the replacement class, the generic row class that works with all types of entities, not that one that only worked with nodes.

The release notes and project page have had a warning for several releases about this.

Any ideas? Thanks!

NASACT

  • I post frequently
  • ***
  • Posts: 289
  • Karma: 9
    • National Association of State Auditors, Comptrollers and Treasurers
  • CiviCRM version: 4.2.2
  • CMS version: Drupal 7
  • MySQL version: 5.1.58 (ubuntu)
  • PHP version: 5.3.5
Re: Integrating CiviEvents with Drupal Calendar
June 06, 2012, 11:54:34 am
I hit a wall with this method because of this error and the feeds method doesn't work with Views 3. The Date iCal module has the best hope to date of handling Views integration for CiviCRM events.  I haven't looked at this in a while but I saw that Views iCal module has been updated which may hold some promise for fixing the Views 3 integration issue.  This literally hit the drupal scene 7 days ago. http://drupal.org/project/views_ical

Also Karen hasn't worked on the Date iCal module in a while so expect something from her relatively shortly. Which she outlines direct iCal feed integration for parsing.  The old Feeds method no longer works with Views 3 to the best of my knowledge as I spent about a week working with it.

Let me know what you find out and when I have time I will go back and try this in my sandbox.
-AJ
My GChat - azon21@gmail.com -  This is where you can find me most days!

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: Integrating CiviEvents with Drupal Calendar
June 07, 2012, 04:21:12 am
I think you could make this work by creating a feed importer that sucks in the RSS from Civi iCal feed and then creates nodes based on the feed fields. Then since they are nodes it should all work with views as well right?

NASACT

  • I post frequently
  • ***
  • Posts: 289
  • Karma: 9
    • National Association of State Auditors, Comptrollers and Treasurers
  • CiviCRM version: 4.2.2
  • CMS version: Drupal 7
  • MySQL version: 5.1.58 (ubuntu)
  • PHP version: 5.3.5
Re: Integrating CiviEvents with Drupal Calendar
June 07, 2012, 06:24:40 am
I thought so too as we used to do this with Views 2. Since Views 3 change I can't get it to work.  It used to work with http://drupal.org/project/parser_ical module and it's dependencies. I can make this work in Views 2 drupal instances but views 3 broke this method. I don't it's being maintained anymore.  The http://drupal.org/project/views_ical module is the closest I could find but it creates feeds from views not nodes to use with calendar view.  The http://drupal.org/project/date_ical module looks to be the best promise but the famous "Karen" from Drupal hasn't worked on it since April and the feature is a future plan.
-AJ
My GChat - azon21@gmail.com -  This is where you can find me most days!

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: Integrating CiviEvents with Drupal Calendar
June 07, 2012, 08:03:30 am
@NASACT I see what you're saying, good point. I does look like there are a few ways around it for temporary fixes if people need one, though not as elegant as a date feed parser would be:

Option 1: Use the Feeds SQL module http://drupal.org/project/feeds_sql as this can fetch queries based on any DB set up in settings.php. Then just run a simple query to pull Civi events set the mappings via Feed importer mappings, and then set it to create new nodes. I haven't used this module myself yet, but it seems like a viable solution that is actively maintained.

Option 2: the way less elegant way would be CSV export of upcoming events and have a feed importer mapped to create new nodes using the CSV parser. Obviously you would need to re-export CSV's every month/week/whatever to stay up-to-date, but having the feed importer all set up and ready to run could make it so this only takes a few minutes of time. Not automatic, but it is an option nonetheless.

NASACT

  • I post frequently
  • ***
  • Posts: 289
  • Karma: 9
    • National Association of State Auditors, Comptrollers and Treasurers
  • CiviCRM version: 4.2.2
  • CMS version: Drupal 7
  • MySQL version: 5.1.58 (ubuntu)
  • PHP version: 5.3.5
Re: Integrating CiviEvents with Drupal Calendar
June 07, 2012, 10:13:03 am
I will take a look at that approach and if I can get it rolling correctly I will try and document it.
-AJ
My GChat - azon21@gmail.com -  This is where you can find me most days!

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Integrating CiviEvents with Drupal Calendar
June 19, 2012, 06:48:34 am
I tried with http://drupal.org/project/civicrm_events and it worked fine for me:

http://demo.civihosting.com/events/calendar

You must follow the installation instructions there of course, but this worked fine, first time. It has some "Undefined property" messages but those can be fixed easily.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

bcobin

  • I post frequently
  • ***
  • Posts: 337
  • Karma: 9
    • InterCreative Media
  • CiviCRM version: 4.3.3
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.9
  • PHP version: 5.3
Re: Integrating CiviEvents with Drupal Calendar
June 27, 2012, 07:30:00 am
I think there may finally be a working implementation method - see http://drupal.org/node/1643468

The civicrm_events module works nicely (with a quick fix) if you're dealing with CiviEvents only from a single site, but if you need to import events from external sources, you'll need a different solution.
« Last Edit: June 27, 2012, 08:06:27 am by bcobin »

NASACT

  • I post frequently
  • ***
  • Posts: 289
  • Karma: 9
    • National Association of State Auditors, Comptrollers and Treasurers
  • CiviCRM version: 4.2.2
  • CMS version: Drupal 7
  • MySQL version: 5.1.58 (ubuntu)
  • PHP version: 5.3.5
Re: Integrating CiviEvents with Drupal Calendar
June 28, 2012, 08:08:36 am
Okay, just wanted to update things a bit.

@bcobin - thanks for the help today, it helped me follow what was going on with things.

The modified version posted at the Drupal page: http://drupal.org/node/1643468 works if you use iCalCreator php class that can be found at http://kigkonsult.se/downloads/index.php

The SQL method suggested by emilyf should work just fine but doesn't help where the desired result is to create and update nodes of various types (usually some simple node you created with a Date field so you can hold the info from the iCal feed itself for each feed, I like to call mine by the organization name I am importing the feed from) iCal feeds into a SINGLE calendar view.  This method works great if you don't like Hershel's suggested method located at http://drupal.org/project/civicrm_events.  Either one works if you want a calendar of your events and nothing more.

So that leaves those of us who need to parse iCal feeds into content(nodes) on our website and then use Views to display in calendar format. This can't be done any other way then to get the iCal Feeds parser working.  I will continue to work with others on this.  Even fixing the Views for CiviCRM really doesn't help mine and bcobin's issue which was originally solved with feeds and the iCalParser.

« Last Edit: June 28, 2012, 08:28:05 am by NASACT »
-AJ
My GChat - azon21@gmail.com -  This is where you can find me most days!

robinhood

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 6
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.1.56
  • PHP version: 5.3.5
Re: Integrating CiviEvents with Drupal Calendar
July 19, 2012, 04:17:09 am
Meh.  It is still a big pile o' alpha code.  I am testing it on a backup copy, and I appreciate that they are making progress, but I am not putting it in production until it stabilizes.  But thanks for the heads up.

sonicthoughts

  • Ask me questions
  • ****
  • Posts: 498
  • Karma: 10
Re: Integrating CiviEvents with Drupal Calendar VIEWS BUG
August 06, 2012, 05:17:24 pm
I'm finding some challenges with views integration.  I'm using a single database (no prefix), 4.15 view 3 and D7.  I confess I recently changed to a WAMP dev environment and that may be the source of my problems (or PHP global variable scope) but I've reproduced the issue on another server.  Can't use views on the demo/sandbox so apologies if this is just my config.

1. create a view using civievent entity.
2. select HTML list of calendar items
3. Get: Fatal error: Class 'calendar_plugin_row_node' not found in sites/all/modules/civicrm/drupal/modules/views/plugins/calendar_plugin_row_civicrm.inc on line 25
4. Added a bug: CRM-10634
change to fields instead of calendar:
4. Add CiviCRM Events: Registration Link Text (Registration Link Text) field
5. Get PHP errors from AJAX refresh - and white screen when opening the view:
Fatal error: require_once(): Failed opening required 'CRM/Core/Config.php' (include_path='.;K:/Program Files/BitNami Drupal Stack/php/PEAR') in G:......sites\all\modules\civicrm\drupal\modules\views\civicrm\civicrm_handler_field_event_link.inc on line 112

I realized that include_path was not being populated so figured this was a PHP global scope issue or civi was not initializing properly .... so I added civicrm_initialize( ); to calendar_plugin_row_civicrm.inc and The registration link worked!

But I got new errors:
Notice: Undefined property: CRM_Core_Config::$enable_cart in civicrm_handler_field_event_link->render_link() (line 114 of G:.....\sites\all\modules\civicrm\drupal\modules\views\civicrm\civicrm_handler_field_event_link.inc).
this looks related to: CRM-9174 and added with CRM-8683 and others have experienced this.  I expect more people would report this if it were not related to specific configs but I figured out a way to hack it and get it to work. :

change civicrm_handler_field_event_link.inc
from:
case 'registration':
        if (user_access('register for events') && $data !== NULL && $data !== '') {
          require_once 'CRM/Core/Config.php';
          $config = CRM_Core_Config::singleton();
       
          if ($config->enable_cart) {
            require_once 'CRM/Event/Cart/BAO/EventInCart.php';
            //TODO don't call for every row
            $link = CRM_Event_Cart_BAO_EventInCart::get_registration_link($values->{$this->aliases['id']});
            return civicrm_views_href($link['label'], $link['path'], $link['query']);
          }
to:
if (user_access('register for events') && $data !== NULL && $data !== '') {
          require_once 'CRM/Core/Config.php';
          $config = CRM_Core_Config::singleton();
       
          if ( $enable_cart = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::EVENT_PREFERENCES_NAME,
            'enable_cart')) {
            require_once 'CRM/Event/Cart/BAO/EventInCart.php';
            //TODO don't call for every row
            $link = CRM_Event_Cart_BAO_EventInCart::get_registration_link($values->{$this->aliases['id']});
            return civicrm_views_href($link['label'], $link['path'], $link['query']);
}

Got me by but looks like there are some hiccups in the views code for events.

bcobin

  • I post frequently
  • ***
  • Posts: 337
  • Karma: 9
    • InterCreative Media
  • CiviCRM version: 4.3.3
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.9
  • PHP version: 5.3
Re: Integrating CiviEvents with Drupal Calendar
August 07, 2012, 03:05:58 pm
Keep your eye on this new Drupal project, which I think will be the ultimate solution for Civi/Drupal calendars. http://drupal.org/project/civicrm_multiday_event

sonicthoughts

  • Ask me questions
  • ****
  • Posts: 498
  • Karma: 10
Re: Integrating CiviEvents with Drupal Calendar
August 07, 2012, 04:50:33 pm
I will give it a try, but I think views offer more power as it exposes all the civicrm entities.  Also, the workflow on this module seems backwards - starting from drupal, but thx I'll check it out. 

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Integrating CiviEvents with Drupal Calendar
August 10, 2012, 11:53:11 am
I have pushed a fix for http://issues.civicrm.org/jira/browse/CRM-10634 into 4.2. Since that release is imminent, it would be great to get your feedback on it.
Basically if you enable the civi event calendar view... it should work. (clear your views cache first after updating civi 4.2 from svn)
Try asking your question on the new CiviCRM help site.

sonicthoughts

  • Ask me questions
  • ****
  • Posts: 498
  • Karma: 10
Re: Integrating CiviEvents with Drupal Calendar
August 13, 2012, 10:50:39 am
I'm still having install issues.  http://forum.civicrm.org/index.php/topic,25643.msg108436.html#msg108436

Pages: 1 2 [3] 4
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Integrating CiviEvents with Drupal Calendar

This forum was archived on 2017-11-26.