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 »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • CiviEvent Error
Pages: [1]

Author Topic: CiviEvent Error  (Read 1292 times)

lance1413

  • Guest
CiviEvent Error
November 28, 2010, 09:20:55 pm
I've installed civievent.  I followed the install and set up guide, and placed civievent calendar in a block.  Saved block and I get this error

user warning: Table 'dop16.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) AND (civicrm_event.is_template = 0)) AND ((DATE_FORMAT(CONVERT_TZ(civicrm_event.start_date, 'UTC', 'America/New_York'), '%Y-%m') <= '2010-11' AND DATE_FORMAT(CONVERT_TZ(civicrm_event.start_date, 'UTC', 'America/New_York'), '%Y-%m') >= '2010-11')) ORDER BY civicrm_event_start_date ASC in /home/content/88/6754888/html/doperdal/sites/all/modules/views/includes/view.inc on line 775.

Any idea how to fix this?

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: CiviEvent Error
November 29, 2010, 09:32:34 pm
Did you add $db_prefix array in your settings.php ?

Check http://drupal.demo.civicrm.org/civicrm/admin/setting/uf&reset=1

Kurund
Found this reply helpful? Support CiviCRM

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: CiviEvent Error
November 30, 2010, 05:32:58 am
What Kurund means, Lance, is to go to the URL

YOURSITE.com/civicrm/admin/setting/uf&reset=1

and copy and paste the code there into your settings.php file in the directory sites/default/

Let us know if that fixes it.
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.

lance1413

  • Guest
Re: CiviEvent Error
November 30, 2010, 12:44:07 pm
I went to: http://wiki.civicrm.org/confluence/display/CRMDOC32/Views2+Integration+Module

I am using a godaddy shared hosting, grid hosting.

I followed the directions from the bullet point 1 because I thought that applied to my situation.  I have a civicrm database and a drupal database, both with godaddy, accessed from the same control panel.

I then followed the instructions from bullet point 3 because I am getting the same error as described in bulet point 3.

"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."

_________________________________________________________________

My script after I made the changes accroding to bullet point 1 & 3 is as follows:

$db_url['default'] = 'mysqli://dop10:Dopal1@dop101256.db.6754888.hostedresource.com/dop10351256';
$db_url['mydb'] ='mysql://civicrmdoal:Dopa3@civicrmdoal.db.6754888.hostedresource.com/civicrmdoperdal?new_link=true';
$db_prefix = array ('default'=>'drupal_','civicrm_event'=>'','civicrm_activity'=>'','civicrm_contact'=>'','civicrm_address'=>'','civicrm_contribution'=>'');

db_set_active('mydb');

db_query('SELECT * FROM table_in_anotherdb');

Switch back to the default connection when finished.
db_set_active('default');

____________________________________________________________________

My php is currently not working and I get a fatal error error on:  db_set_active('mydb');

I know I need to figure out what I need to replace "drupal" with in the array.


But, even before all of this.....everything refrences VIEWS2.  Where do I get Views2?  I am only finding in drupal the module "Views".   Possibly I have the right module or maybe I don't, I am not sure.  That may be part of the problem. 
 

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: CiviEvent Error
November 30, 2010, 12:54:47 pm
1. You have different users for your two databases. The user for the Drupal database I believe needs to have SELECT rights to the CiviCRM database for Views.

2. Views2 refers to version 2.x of the Views module, so you have the right module.
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.

lance1413

  • Guest
Re: CiviEvent Error
November 30, 2010, 01:08:38 pm
thank you for your comment.

My php after I added the info you told me to get is:

$db_url['default'] = 'mysqli://dop1026:Dope3@dop106.db.678.hostedresource.com/dop1026';
 $db_url['mydb'] ='mysql://civicrmdl:Dop@civicrmdl.db.6758.hostedresource.com/civicrmdopl?new_link=true';
$db_prefix = array ('default'=>'drupal_','civicrm_event'=>'','civicrm_activity'=>'','civicrm_contact'=>'','civicrm_address'=>'','civicrm_contribution'=>'');

db_set_active('mydb');

db_query('SELECT * FROM table_in_anotherdb');

//Switch back to the default connection when finished.

db_set_active('default');

$db_prefix = array(
  'civicrm_acl'                              => 'civicrmdoal.',
  'civicrm_acl_cache'                        => 'civicrmdoal.',
  'civicrm_acl_contact_cache'                => 'civicrmdopl.',
  'civicrm_acl_entity_role'                  => 'civicrmdopl.',
  'civicrm_activity'                         => 'civicrmdopel.',
  'civicrm_activity_assignment'              => 'civicrmdopl.',
  'civicrm_activity_target'                  => 'civicrmdopl.',

etc.

I am getting:

Fatal error: Call to undefined function db_set_active() in /home/content/88/6754888/html/doperdal/sites/default/settings.php on line 96 = db_set_active('mydb');


I am sure something I need to take something out of the first part. But I am not sure what.  
« Last Edit: November 30, 2010, 06:18:55 pm by lance1413 »

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: CiviEvent Error
November 30, 2010, 01:15:38 pm
Remove

Code: [Select]
db_set_active('mydb');

db_query('SELECT * FROM table_in_anotherdb');

//Switch back to the default connection when finished.

db_set_active('default');

But you seem to have a bigger problem. Seems you don't have what I wrote:

Quote
The user for the Drupal database I believe needs to have SELECT rights to the CiviCRM database for Views.

because this code you posted:

Code: [Select]
$db_prefix = array(
  'civicrm_acl'                              => 'civicrmdoal.',
  'civicrm_acl_cache'                        => 'civicrmdoal.',

will not work. Seems it's wrong because your Drupal user does not have rights to the CiviCRM database.
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.

lance1413

  • Guest
Re: CiviEvent Error
November 30, 2010, 03:03:50 pm
    You are correct.  I got this error:

    user warning: SELECT command denied to user 'dp1026'@'174.201.199.272' for table 'civicrm_event' query: SELECT civicrm_event.id AS id, civicrm_event.start_date AS civicrm_event_start_date, civicrm_event.title AS civicrm_event_title FROM civicrmdoperdal.civicrm_event civicrm_event WHERE ((civicrm_event.is_active <> 0) AND (civicrm_event.is_public <> 0) AND (civicrm_event.is_template = 0)) AND ((DATE_FORMAT(CONVERT_TZ(civicrm_event.start_date, 'UTC', 'America/New_York'), '%Y-%m') <= '2010-11' AND DATE_FORMAT(CONVERT_TZ(civicrm_event.start_date, 'UTC', 'America/New_York'), '%Y-%m') >= '2010-11')) ORDER BY civicrm_event_start_date ASC in /home/content/88/6754888/html/doperdal/sites/all/modules/views/includes/view.inc on line 775.


    I'm not sure how to fix it.  I thought bullet point #1 addressed the issue?

"If your CiviCRM install uses a different database to your Drupal install, ensure that your Drupal DB user has SELECT rights to your CiviCRM DB. Some hosting platforms might make this difficult. For more information about setting up Drupal multi-database access: http://drupal.org/node/18429"

The bullet point is what propted me to write the following lines in my php.

$db_url['default'] = 'mysqli://dop1026:Dope3@dop106.db.678.hostedresource.com/dop1026';
 $db_url['mydb'] ='mysql://civicrmdl:Dop@civicrmdl.db.6758.hostedresource.com/civicrmdopl?new_link=true';
$db_prefix = array ('default'=>'drupal_','civicrm_event'=>'','civicrm_activity'=>'','civicrm_contact'=>'','civicrm_address'=>'','civicrm_contribution'=>'');


Possibly there is a mistake in my scripting? 


Which also brings up the issue with the following part of the array:

('default'=>'drupal_','civicrm_event'=>'','civicrm_activity'=>'','civicrm_contact'=>'','civicrm_address'=>'','civicrm_contribution'=>'');

directions are --- NOTE: your prefix may be something other then drupal_, just replace drupal_ with whatever prefix you have configured.

Where do I locate my prefix?     


The prefix is only part of the problem, the other part most likely is the [default], [mydb].

Any idea what the solution is?
« Last Edit: November 30, 2010, 03:34:15 pm by lance1413 »

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: CiviEvent Error
December 01, 2010, 07:16:35 am
Sorry I don't have experience with this type of setup so I can't assist any further.
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.

lance1413

  • Guest
Re: CiviEvent Error
December 01, 2010, 11:11:22 am
Thanks for the help.  I appreciate it.  I reposted in the module section.


Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • CiviEvent Error

This forum was archived on 2017-11-26.