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) »
  • Calendar + Views2 + CiviEvents Throws an Error
Pages: [1]

Author Topic: Calendar + Views2 + CiviEvents Throws an Error  (Read 3120 times)

oban

  • I post occasionally
  • **
  • Posts: 31
  • Karma: 2
Calendar + Views2 + CiviEvents Throws an Error
July 03, 2009, 01:50:17 pm
I have come across this error after enabling the calendar view. When I went to http://drupal.dev/calendar, I saw this error message and my events weren't in the calendar. Just to make sure, I checked the other posts and crossed off any potential issues that may have caused it such as Date API being unpatched (that wasn't the case) or not using the latest CiviCRM (I am using 2.2.5).

Here is the error message. It appears that the view is trying to find the civicrm_event table in the drupal database. I don't know what could have happened here.

Quote

    * user warning: Table 'acquia_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, DATE_FORMAT((civicrm_event.start_date + INTERVAL -14400 SECOND), '%Y%m%d%H') AS civicrm_event_start_date_hour FROM civicrm_event civicrm_event WHERE (civicrm_event.is_active <> 0) AND (civicrm_event.is_public <> 0) ORDER BY civicrm_event_start_date_hour ASC in C:\Users\picardo-alt\Sites\acquia-drupal-site\acquia-drupal\modules\acquia\views\includes\view.inc on line 759.
    * user warning: Table 'acquia_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, DATE_FORMAT((civicrm_event.start_date + INTERVAL -14400 SECOND), '%Y%m%d%H') AS civicrm_event_start_date_hour FROM civicrm_event civicrm_event WHERE (civicrm_event.is_active <> 0) AND (civicrm_event.is_public <> 0) ORDER BY civicrm_event_start_date_hour ASC in C:\Users\picardo-alt\Sites\acquia-drupal-site\acquia-drupal\modules\acquia\views\includes\view.inc on line 759.





PS: strange part of it is, the block view seems to be working correctly, though.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Calendar + Views2 + CiviEvents Throws an Error
July 03, 2009, 02:22:50 pm
Is your CiviCRM in the same DB as your Drupal? There is something on the wiki you need to do if not (I didn't have to so I can't remember the details).

Is the table name

acquia_drupal.civicrm_event

valid?
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

oban

  • I post occasionally
  • **
  • Posts: 31
  • Karma: 2
Re: Calendar + Views2 + CiviEvents Throws an Error
July 03, 2009, 02:36:58 pm
Quote from: Eileen on July 03, 2009, 02:22:50 pm
Is your CiviCRM in the same DB as your Drupal? There is something on the wiki you need to do if not (I didn't have to so I can't remember the details).

Is the table name

acquia_drupal.civicrm_event

valid?

I guess I should have made it clear. CiviCRM is installed on a separate database, and I think I know what you are referring to. I did grant all privileges to the Drupal user in the database for the civicrm database, so it should be able to use that database, which is called acquia_civicrm.

« Last Edit: July 03, 2009, 02:38:30 pm by picardo »

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Calendar + Views2 + CiviEvents Throws an Error
July 03, 2009, 02:43:25 pm
Yeah - this is what I was referring to

http://wiki.civicrm.org/confluence/display/CRMDOC/Views2+Integration+Module

If you have CiviCRM and Drupal installed on the same database, and drupal tables are prefixed, you might receive an error in your views saying table does not exist, if this happens, you need to alter your drupal sites/default/settings.php file.  find the part that says $db_prefix = 'drupal_'; and change it to this: $db_prefix = array ('default'=>'drupal_','civicrm_event'=>'','civicrm_activity'=>'','civicrm_contact'=>'','civicrm_address'=>'','civicrm_contribution'=>'');  NOTE: your prefix may be something other then drupal_, just replace drupal_ with whatever prefix you have configured.
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

oban

  • I post occasionally
  • **
  • Posts: 31
  • Karma: 2
Re: Calendar + Views2 + CiviEvents Throws an Error
July 03, 2009, 03:43:18 pm
Quote from: Eileen on July 03, 2009, 02:43:25 pm

If you have CiviCRM and Drupal installed on the same database, and drupal tables are prefixed, you might receive an error in your views saying table does not exist

But I don't have them in the same database. That's why I am asking.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Calendar + Views2 + CiviEvents Throws an Error
July 03, 2009, 03:51:50 pm
Sorry - you are right. It does say it applies to the same database - It still sounds a lot like your problem though.
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

WallyJ

  • Guest
Re: Calendar + Views2 + CiviEvents Throws an Error
August 08, 2009, 03:44:44 pm
I am getting the exact same problem. It it seems as if the query is putting the drupal db in front of the civicrm db info in some weird combination.

My CiviCRM db is separate from my Drupal db as well.

I looked in both settings files and the info seems to be correct.

Picardo... did you figure out what the problem was?

I followed these instructions to set up the connection between CiviEvents and Calendar
http://wiki.civicrm.org/confluence/display/CRMDOC/Using+Drupal+Calendar+with+CiviEvent

Still get the error.

Thanks!

oban

  • I post occasionally
  • **
  • Posts: 31
  • Karma: 2
Re: Calendar + Views2 + CiviEvents Throws an Error
August 08, 2009, 04:53:54 pm
Yeah, I did manage to fix it. I switched to a more recent version of CiviCRM and the error went away. Could have been 2.2.5.

janamills

  • Guest
Re: Calendar + Views2 + CiviEvents Throws an Error
August 28, 2009, 03:36:46 am
I'm on 2.2.8 and have the same problem. will post here if I manage to get it sorted.

janamills

  • Guest
Re: Calendar + Views2 + CiviEvents Throws an Error
August 28, 2009, 05:03:23 am
ok after much consternation have managed to find a solution.

My drupal and civicrm databases are separate with no prefixes on drupal tables. Yet still with no luck using civicrm 2.2.8, views 2x and drupal 6x.

The code from here didn't quite work just like that i had to change it to the following:
http://wiki.civicrm.org/confluence/display/CRMDOC/Views2+Integration+Module

Code: [Select]
$db_prefix = array(
'default' => '',
'civicrm_acl' => 'civicrm_database.'
)

obviously you have to repeat that second array var for all the others in the list at the page at the wiki and any others you have to add. replace "civicrm_database" with the name of your civicrm database and stick the dot at the end so that sql will call to the right database for tables rather than looking in the drupal one.

Hope this helps.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Calendar + Views2 + CiviEvents Throws an Error

This forum was archived on 2017-11-26.