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 Views Integration
Pages: [1] 2

Author Topic: Drupal Views Integration  (Read 7030 times)

damaxl

  • I post occasionally
  • **
  • Posts: 46
  • Karma: 0
  • CiviCRM version: 4.1.2 DE
  • CMS version: Drupal 7.12 / 7.14
  • MySQL version: 14.12
  • PHP version: 5.2.6
Drupal Views Integration
January 18, 2012, 08:05:56 pm
Hello,

we need to generate special reports for events. There are custom fields in contacts (e.g. vegetarian or normal food, what function does the person have in it's institution) we have to show in a list. The standart listing and report capabilities don't provide this.
So we tried to solve this with Drupal views. Unfortunately we are unable to setup this.
Item 3 in http://wiki.civicrm.org/confluence/display/CRMDOC40/Views3+Integration says, one should call http://yourdomain.com/civicrm/admin/setting/uf?reset=1 and on an output page there should appear a php array. In our case there appeares only one field where to put in the name of the Drupal user table.

The configuration is CiviCRM 4.0.5 on Drupal 7.9

Any idea how to manage this?

Is there a tutorial or example for Drupal views on CiviCRM?

Thanks in advance and greetings.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Drupal Views Integration
January 19, 2012, 01:50:21 pm
> Is there a tutorial or example for Drupal views on CiviCRM?

That wiki page is it. Do you have Views enabled?
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.

damaxl

  • I post occasionally
  • **
  • Posts: 46
  • Karma: 0
  • CiviCRM version: 4.1.2 DE
  • CMS version: Drupal 7.12 / 7.14
  • MySQL version: 14.12
  • PHP version: 5.2.6
Re: Drupal Views Integration
January 23, 2012, 03:20:46 am
Hello Hershel,

oh silly me! Now the array is displayed how described.

Unfortunately there's another problem now. In my installation, the array member 'prefix' is set to 'd7_'. When placing the array into settings.php as described, this will be overwritten and Drupal isn't able to find it's tables anymore.
Any idea how to solve this? Or is there only one chance to rename all tables an strip the prefix 'd7_'?

And the next question. If databases are different (Drupal in db1 and CiviCRM in db2), how can one manage different db accounts? In an article I read, that there must be she same user for the two different databases. Can't find this article anymore and remeber that it was for 3.4 version and Drupal 6 and thought this isn'r relevant fpr 4.0 anymore.

Thank you in advance!
 

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Drupal Views Integration
January 23, 2012, 03:45:29 am
> Any idea how to solve this?

Put a default entry, as the first row, into the array like this:

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

The two DBs needn't have the same user, but the user for Drupal needs to have SELECT access to the CiviCRM DB.
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.

tog22

  • I’m new here
  • *
  • Posts: 20
  • Karma: 0
  • CiviCRM version: CiviCRM 4
  • CMS version: Drupal 7
  • MySQL version: Varies
  • PHP version: Varies
Re: Drupal Views Integration
July 11, 2012, 08:59:13 am
I have the same issue damaxl described:

Quote
Item 3 in http://wiki.civicrm.org/confluence/display/CRMDOC40/Views3+Integration says, one should call http://yourdomain.com/civicrm/admin/setting/uf?reset=1 and on an output page there should appear a php array. In our case there appeares only one field where to put in the name of the Drupal user table.

However, I have enabled the Views module (and tried disabling and re-enabling it a few times). Within Views' interface I can add Views of 'Type: CiviCRM Contacts' but they appear not to find contacts.

(Using Drupal 7.12 and CiviCRM 4.05.)

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Drupal Views Integration
July 11, 2012, 10:49:28 am
tog22, what do you see on http://yourdomain.com/civicrm/admin/setting/uf?reset=1  ? Do you see a large array?
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.

tog22

  • I’m new here
  • *
  • Posts: 20
  • Karma: 0
  • CiviCRM version: CiviCRM 4
  • CMS version: Drupal 7
  • MySQL version: Varies
  • PHP version: Varies
Re: Drupal Views Integration
July 12, 2012, 02:32:32 am
No, I just see a field for 'Drupal Users Table Name' containing 'users'.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Drupal Views Integration
July 12, 2012, 04:57:31 am
I tested this on a Drupal 7 CiviCRM 4.1.3 site and I see the same thing. In all previous versions there was a large array there as per http://wiki.civicrm.org/confluence/display/CRMDOC41/Views3+Integration

I don't see that there now BUT Views works for me without it.

What version of CiviCRM and Views do you have?
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.

tog22

  • I’m new here
  • *
  • Posts: 20
  • Karma: 0
  • CiviCRM version: CiviCRM 4
  • CMS version: Drupal 7
  • MySQL version: Varies
  • PHP version: Varies
Re: Drupal Views Integration
July 12, 2012, 06:33:13 am
CiviCRM 4.0.6

Views 7.x-3.3

Views don't work for me - when i try to create them, I see the following error in the preview:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'sant0317_ceacrm.drupal_civicrm_contact' doesn't exist

However, drupal_ is the prefix only for drupal tables in that database - the relevant table is 'sant0317_ceacrm.civicrm_contact' which does exist

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Drupal Views Integration
July 12, 2012, 12:26:14 pm
Yes, you need that integration code. Not sure why you lack it on that page. Perhaps copy the code from the first post http://drupal.org/node/1627140 and replace all dafmr_crm with sant0317_ceacrm.

Try that and see.
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.

tog22

  • I’m new here
  • *
  • Posts: 20
  • Karma: 0
  • CiviCRM version: CiviCRM 4
  • CMS version: Drupal 7
  • MySQL version: Varies
  • PHP version: Varies
Re: Drupal Views Integration
October 15, 2012, 05:40:08 am
A completely fresh install of Drupal (with Drupal and CiviCRM using separate databases) fixed this for me...

rogical

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 1
  • CiviCRM version: 4.2
  • CMS version: Drupal
  • MySQL version: 5.1
  • PHP version: 5.3
Re: Drupal Views Integration
November 08, 2012, 07:40:59 am
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'civicrm_contacts' for key 'name': INSERT INTO {views_view} (name, description, tag, base_table, human_name, core) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5); Array ( [:db_insert_placeholder_0] => civicrm_contacts [:db_insert_placeholder_1] => [:db_insert_placeholder_2] => default [:db_insert_placeholder_3] => civicrm_contact [:db_insert_placeholder_4] => Civicrm Contacts [:db_insert_placeholder_5] => 7 ) in views_db_object->save_row() (line 1994 of /home/idxcanad/public_html/rah/sites/all/modules/views/includes/view.inc).

got this issue when saving views..

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Drupal Views Integration
November 08, 2012, 07:49:38 am
Not sure why that happened, but try changing the name of your View and then save.
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.

rogical

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 1
  • CiviCRM version: 4.2
  • CMS version: Drupal
  • MySQL version: 5.1
  • PHP version: 5.3
Re: Drupal Views Integration
November 09, 2012, 01:47:19 am
Thanks, just solved like this way.

Michael

  • I post occasionally
  • **
  • Posts: 69
  • Karma: 2
  • Isn't this just terrific?
  • CiviCRM version: 4.4.0
  • CMS version: Drupal 7.23
  • MySQL version: 5.3.19
  • PHP version: 5.5.30
Re: Drupal Views Integration
March 06, 2013, 08:30:26 am
I am having a similar problem but when I try: civicrm/admin/setting/uf?reset=1

... I get the "Settings - Drupal Integration" page but nothing else, no php array. When I try to create a View using CiviEvents the selection in Drupal where CiviEvents is chosen as the "Show" option always changes itself to CiviCRM Relationships.

I tried saving my views under different names but it didn't help. All I get is a WSOD. (A lack of available memory issue, perhaps?)

Any help will be very much appreciated.

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Drupal Views Integration

This forum was archived on 2017-11-26.