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 CiviContribute (Moderator: Donald Lobo) »
  • SQL error when using CiviContribute "relationship" in the Drupal module "views"
Pages: [1]

Author Topic: SQL error when using CiviContribute "relationship" in the Drupal module "views"  (Read 671 times)

Vandalf

  • I post occasionally
  • **
  • Posts: 45
  • Karma: 0
SQL error when using CiviContribute "relationship" in the Drupal module "views"
May 05, 2012, 05:40:34 pm
Hello, sorry if this is the wrong forum to post in, but I believe that this has got to do with the CiviContribute module (of course, I may very well be very wrong...).

What happens is, I've created a view (Drupal Views) that shows contact information. This works well, and I'm using a relationship "CiviCRM Contacts: Drupal ID". No problem, this is all fine.

Now, I also wanted to include a block with Contribution information. This is where the problem begins.
I get the following errors, using the possible different settings (please forgive me if I'm not being clear, I do presume some knowledge of Drupal Views module, which may be inappropriate here, not being a Drupal forum):


Require this relation
Relation: "Drupal user"
Code: [Select]
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'users_civicrm_uf_match2__civicrm_contact.contact_id' in 'on clause'

Do not require this relation
Relation: "Drupal user"
Code: [Select]
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'users_civicrm_uf_match2__civicrm_contact.contact_id' in 'on clause'

Require this relation
Relation: "None"
Code: [Select]
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'civicrm_contact.contact_id' in 'on clause'

Do not require this relation
Relation: "None"
Code: [Select]
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'civicrm_contact.contact_id' in 'on clause'

What I gather from this is that the relationship needs some column "contact_id" in the table "civicrm_contact", and this is of course not there. But why does it look for this table if it does not exist? Is there something somewhere in the CiviContribute module that refers to this column? I cannot believe that it is Views related, as the other relationship works without problems, but then again, what do I know when it comes down to it....

Appreciate every possible hint on this!


PS! I'm on Drupal 7.14, Views 7.x-3.3 and CiviCRM 4.1.2 (I believe these are all latest available "recommended" versions at the time being)
PPS! I've asked mr. Google, and he pointed out quite a few issues around the web concerning SQLSTATE[42S22] errors, but none seemed to pinpoint my problem (as far as I could see and/or understand...). And, I couldn't find this on this forum neither..?

nimzie

  • I post occasionally
  • **
  • Posts: 85
  • Karma: 1
Re: SQL error when using CiviContribute "relationship" in the Drupal module "views"
September 18, 2012, 11:41:33 am
Have you sorted this issue? If so, what did you do to sort? I am experiencing the exact same thing.

Vandalf

  • I post occasionally
  • **
  • Posts: 45
  • Karma: 0
Re: SQL error when using CiviContribute "relationship" in the Drupal module "views"
October 22, 2012, 01:18:02 am
Sorry, no I haven't...  :-\
But it seems to me that it's sort of "doubling" parts of the sql... Really strange, but it's probably just something that I'm doing wrong...

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: SQL error when using CiviContribute "relationship" in the Drupal module "views"
October 22, 2012, 04:11:38 am
Quote from: Vandalf on October 22, 2012, 01:18:02 am
it's probably just something that I'm doing wrong...

Not necessarily. We don't at present have a maintainer for Views integration for CiviCRM so no one is really able to address this issue. It may be a bug in the code. If you can look into the code (or if you have someone who can) and see a bit, the job of maintainer is looking for a new volunteer. :)
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.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • SQL error when using CiviContribute "relationship" in the Drupal module "views"

This forum was archived on 2017-11-26.