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 Drupal Modules (Moderator: Donald Lobo) »
  • Drupal doesn't recognize CiviEvent date as valid argument for calendar
Pages: 1 [2] 3

Author Topic: Drupal doesn't recognize CiviEvent date as valid argument for calendar  (Read 24178 times)

jalama

  • I post frequently
  • ***
  • Posts: 176
  • Karma: 22
    • Rooty Hollow LLC
  • CiviCRM version: 3.3.5
  • CMS version: Drupal 6 and 7
  • MySQL version: 5.1
  • PHP version: 5.2.5 and 5.3
Re: Drupal doesn't recognize CiviEvent date as valid argument for calendar
May 05, 2009, 11:46:49 am
patches

here
http://issues.civicrm.org/jira/browse/CRM-4451
and here
http://issues.civicrm.org/jira/browse/CRM-4450
http://www.rootyhollow.com

marqpdx

  • I post occasionally
  • **
  • Posts: 58
  • Karma: 2
Re: Drupal doesn't recognize CiviEvent date as valid argument for calendar
May 07, 2009, 04:06:52 pm
Jalama,
Extreme thanks!!
It worked.

I now have CiviEvents showing up in a full calendar.
The final piece of the puzzle was this patch (which you noted, but for some reason i did last or it got overwritten):
http://drupal.org/node/453688?mode=2&sort=2

Thanks again for pulling this together; this is huge for us and it works super slick!!!
gratefully,
m

oban

  • I post occasionally
  • **
  • Posts: 31
  • Karma: 2
Re: Drupal doesn't recognize CiviEvent date as valid argument for calendar
May 27, 2009, 09:33:59 pm
Could I ask you if you have CiviCRM on the same database as drupal? I followed your instructions, but I don't know how to get around these errors:

    * user warning: Table 'drupal.civicrm_event' doesn't exist query: SELECT civicrm_event.id AS id, civicrm_event.start_date AS civicrm_event_start_date, civicrm_event.title AS civicrm_event_title FROM civicrm_event civicrm_event WHERE (civicrm_event.is_active <> 0) AND (civicrm_event.is_public <> 0) ORDER BY civicrm_event_start_date ASC in /var/www/html/modules/views/includes/view.inc on line 735.
    * user warning: Table 'drupal.civicrm_event' doesn't exist query: SELECT civicrm_event.id AS id, civicrm_event.start_date AS civicrm_event_start_date, civicrm_event.title AS civicrm_event_title FROM civicrm_event civicrm_event WHERE (civicrm_event.is_active <> 0) AND (civicrm_event.is_public <> 0) ORDER BY civicrm_event_start_date ASC in /var/www/html/modules/views/includes/view.inc on line 735.
    * warning: date_format() expects parameter 1 to be DateTime, null given in /var/www/html/modules/calendar/theme/theme.inc on line 15.
    * warning: date_format() expects parameter 1 to be DateTime, null given in /var/www/html/modules/calendar/theme/theme.inc on line 16.


Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Drupal doesn't recognize CiviEvent date as valid argument for calendar
May 27, 2009, 09:38:18 pm
Did you upgrade your Drupal modules (to the latest modules & the patch mentioned in the previous post)?
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

jalama

  • I post frequently
  • ***
  • Posts: 176
  • Karma: 22
    • Rooty Hollow LLC
  • CiviCRM version: 3.3.5
  • CMS version: Drupal 6 and 7
  • MySQL version: 5.1
  • PHP version: 5.2.5 and 5.3
Re: Drupal doesn't recognize CiviEvent date as valid argument for calendar
May 28, 2009, 06:00:29 am
If you have civi & drupal in different databases you need to be sure and tell Drupal where the CiviCRM tables are in the settings.php file.  Which is done by setting the $db_prefix variable. You can get the value in you Global settings or http://<example.com>/civicrm/admin/setting/uf?reset=1.

This only works on the 2.2 branch of CiviCRM and 6.x.2.x of Date API (specifically CiviCRM 2.2.2 with the civicrm & date api patches and 2.2.3 with only the date api patch)
http://www.rootyhollow.com

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Drupal doesn't recognize CiviEvent date as valid argument for calendar
May 28, 2009, 01:28:11 pm
And that picture is a spitting image of you Jim....
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

jalama

  • I post frequently
  • ***
  • Posts: 176
  • Karma: 22
    • Rooty Hollow LLC
  • CiviCRM version: 3.3.5
  • CMS version: Drupal 6 and 7
  • MySQL version: 5.1
  • PHP version: 5.2.5 and 5.3
Re: Drupal doesn't recognize CiviEvent date as valid argument for calendar
May 28, 2009, 01:49:26 pm
That was before the plastic surgery :)
http://www.rootyhollow.com

oban

  • I post occasionally
  • **
  • Posts: 31
  • Karma: 2
Re: Drupal doesn't recognize CiviEvent date as valid argument for calendar
May 30, 2009, 10:29:37 pm
Quote from: jalama on May 28, 2009, 06:00:29 am
If you have civi & drupal in different databases you need to be sure and tell Drupal where the CiviCRM tables are in the settings.php file.  Which is done by setting the $db_prefix variable. You can get the value in you Global settings or http://<example.com>/civicrm/admin/setting/uf?reset=1.



Ok, I fixed the first two errors. But the last two keep showing up.

    * warning: date_format() expects parameter 1 to be DateTime, null given in /var/www/html/modules/calendar/theme/theme.inc on line 15.
    * warning: date_format() expects parameter 1 to be DateTime, null given in /var/www/html/modules/calendar/theme/theme.inc on line 16.


I am using the latest version of Drupal and CiviCRM, and I modified the date/includes/date_api_fields.inc file as you said.  I followed your instructions on this comment, by the way -- maybe they were not final?

http://forum.civicrm.org/index.php/topic,6320.msg34263.html#msg34263

I also looked through the patch file civicrm.views.inc.date.api.patch, where there was a block that wasn't mentioned before:

  
Code: [Select]
  //CiviCRM Events - FIELDS


  //Date API Integration
  if(module_exists('date_api')){
     $data[civicrm_event]['date_argument'] = array(
                                                'group' => t('Date'),
                                                'title' => t('Date'),
                                                'help' => t('Filter any Views date field by a date argument, using any common ISO date/period format (i.e. YYYY, YYYY-MM, YYYY-MM-DD, YYYY-W99, YYYY-MM-DD--P3M, P90D, etc).'),
                                                 'argument' => array(
                                                                    'handler' => 'date_api_argument_handler',
                                                                     'empty name field' => t('Undated'),
                                                                   ),
                                                 );
   }

I added that to the  civicrm.views.inc, but that didn't make any difference. :-(


Is there something I am missing?  

« Last Edit: June 01, 2009, 01:17:09 pm by picardo »

jalama

  • I post frequently
  • ***
  • Posts: 176
  • Karma: 22
    • Rooty Hollow LLC
  • CiviCRM version: 3.3.5
  • CMS version: Drupal 6 and 7
  • MySQL version: 5.1
  • PHP version: 5.2.5 and 5.3
Re: Drupal doesn't recognize CiviEvent date as valid argument for calendar
June 01, 2009, 05:11:43 am
If you are running the latest version of Civi you should not have had to add anything to the civicrm.views.inc file as that code was included with CiviCRM as of 2.2.3

Can you be more specific as to the versions you are running?  To help me reproduce the error.

PHP?
Drupal Core?
Date API Module?
Calendar Module?
CiviCRM?
« Last Edit: June 01, 2009, 05:17:46 am by jalama »
http://www.rootyhollow.com

oban

  • I post occasionally
  • **
  • Posts: 31
  • Karma: 2
Re: Drupal doesn't recognize CiviEvent date as valid argument for calendar
June 01, 2009, 07:07:16 am
Quote from: jalama on June 01, 2009, 05:11:43 am
If you are running the latest version of Civi you should not have had to add anything to the civicrm.views.inc file as that code was included with CiviCRM as of 2.2.3

Ah, sorry, I didn't realize there was a version after 2.2.2. Mine is actually 2.2.2. Here is the rundown on my setup:

CiviCRM: 2.2.2
Drupal: 6.12
PHP: 5.2.6
Date API: 6.x.2.2
Calendar: 6.x-2.1



PS: I don't know if it's related or not, but since I added the new view there has also been an incredible slowdown of pageload time.  It takes minutes for some pages to load. This is the only change I made to the system recently...
« Last Edit: June 01, 2009, 07:12:04 am by picardo »

jalama

  • I post frequently
  • ***
  • Posts: 176
  • Karma: 22
    • Rooty Hollow LLC
  • CiviCRM version: 3.3.5
  • CMS version: Drupal 6 and 7
  • MySQL version: 5.1
  • PHP version: 5.2.5 and 5.3
Re: Drupal doesn't recognize CiviEvent date as valid argument for calendar
June 01, 2009, 12:16:21 pm
once you get to 2.2.3+ can you let me know if it is still there.


did you paste this function in?

Code: [Select]
function civicrm_date_api_fields($field) {
  $values = array(
    // The type of date: DATE_UNIX, DATE_ISO, DATE_DATETIME.
    'sql_type' => DATE_DATETIME,
    // Timezone handling options: 'none', 'site', 'date', 'utc'.
    'tz_handling' => 'site',
    // Needed only for dates that use 'date' tz_handling.
    'timezone_field' => '',
    // Needed only for dates that use 'date' tz_handling.
    'offset_field' => '',
    // Array of "table.field" values for related fields that should be
    // loaded automatically in the Views SQL.
    'related_fields' => array(),
    // Granularity of this date field's db data.
    'granularity' => array('year', 'month', 'day', 'hour', 'minute', 'second'),
  );

  switch ($field) {
    case 'civicrm_event.start_date':
    case 'civicrm_event.end_date':
    case 'civicrm_event.registration_start_date':
    case 'civicrm_event.registration_end_date':
      return $values;
  }
}

http://www.rootyhollow.com

oban

  • I post occasionally
  • **
  • Posts: 31
  • Karma: 2
Re: Drupal doesn't recognize CiviEvent date as valid argument for calendar
June 03, 2009, 08:54:44 pm
Quote from: jalama on June 01, 2009, 12:16:21 pm
once you get to 2.2.3+ can you let me know if it is still there.


did you paste this function in?


Yup. It's all there. I don't understand why it's not working. There are only two modifications, right? To the Date Api and to the civicrm.views.inc.

I tried re-importing the view you pasted above, and there is something I hadn't noticed before. There is an error in the arguments field of the view. Not being an expert on this view, I'm including it below. It may be nothing...

Error: handler for civicrm_event > date_argument doesn't exist!

I can try updating CiviCRM to 2.2.3. Hopefully that makes a difference.

jalama

  • I post frequently
  • ***
  • Posts: 176
  • Karma: 22
    • Rooty Hollow LLC
  • CiviCRM version: 3.3.5
  • CMS version: Drupal 6 and 7
  • MySQL version: 5.1
  • PHP version: 5.2.5 and 5.3
Re: Drupal doesn't recognize CiviEvent date as valid argument for calendar
June 04, 2009, 02:17:48 pm
that error indicates that Views cannot find the argument handler that the field is mapped to.  Which is odd since it the handler provided by the date api module 'date_api_argument_handler'

Yea updating to 2.2.3 should fix things
http://www.rootyhollow.com

mschlicting

  • Guest
Re: Drupal doesn't recognize CiviEvent date as valid argument for calendar
June 08, 2009, 01:01:23 pm
Hi,

I'm getting the exact same error.  In my views once I enable the civi_events view and go to edit, the arguments box says,

Error: handler for civicrm_event > date_argument doesn't exist!

Cvicrm version 2.2.5
Drupal version 6.12

Anything else to be checking?  I've verified all the code blocks in this post.  Everything looks good and date_argument shows up in the include files.

jalama

  • I post frequently
  • ***
  • Posts: 176
  • Karma: 22
    • Rooty Hollow LLC
  • CiviCRM version: 3.3.5
  • CMS version: Drupal 6 and 7
  • MySQL version: 5.1
  • PHP version: 5.2.5 and 5.3
Re: Drupal doesn't recognize CiviEvent date as valid argument for calendar
June 08, 2009, 01:24:44 pm
I have tried reproduce this to no avail.

The error is saying that is cannot find the "date_api_argument_handler" class which is declared by the date api module.  For that to be an issue you would also have to have issues with "normal" Drupal/CCK calendars, do you have any of those up and running?

Can you try clearing the views cache (under Site Building | Views | Tools)
http://www.rootyhollow.com

Pages: 1 [2] 3
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Drupal doesn't recognize CiviEvent date as valid argument for calendar

This forum was archived on 2017-11-26.