Have a question about CiviCRM? Get it answered quickly at the new CiviCRM Stack Exchange Q+A siteThis forum was archived on 25 November 2017. Learn more.How to get involved.What to do if you think you've found a bug.
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.
//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'), ), ); }
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
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; }}
once you get to 2.2.3+ can you let me know if it is still there.did you paste this function in?