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) »
  • Unknown column 'uf_id' in 'on clause' query
Pages: [1]

Author Topic: Unknown column 'uf_id' in 'on clause' query  (Read 1622 times)

mariagwyn

  • I post frequently
  • ***
  • Posts: 149
  • Karma: 4
  • CiviCRM version: CiviCRM 3.3.3
  • CMS version: Drupal 6.20
  • MySQL version: 5.2.14
  • PHP version: 5.0.91-50-log
Unknown column 'uf_id' in 'on clause' query
August 03, 2009, 08:56:12 pm
I created a working version of a view which showed Civicrm contact data, and by creating a relationship with the drupal user id, snf an argument based on the Drupal Organic Group (made available by the previous relationship).  It worked beautifully, I could automatically embed the manager of the group's contact information into the view itself.

I them imported this view from the test site to my current dev site.  I now receive this error: Unknown column 'uf_id' in 'on clause' query.

Since I was testing on an newer version of civicrm (2.2.6) and am now on an older version (2.2.2).  There appears to be no difference civicrm.views.inc (around line 92 is the reference uf_id).  The query which is run however, is completely different.

Here is the working query:
Code: [Select]
SELECT civicrm_contact.id AS id,
   civicrm_contact.display_name AS civicrm_contact_display_name,
   civicrm_contact.job_title AS civicrm_contact_job_title,
   civicrm_contact.home_URL AS civicrm_contact_home_URL
 FROM mgwynm_civicrmdev.civicrm_contact civicrm_contact
 LEFT JOIN mgwynm_civicrmdev.civicrm_uf_match civicrm_uf_match ON civicrm_contact.id = civicrm_uf_match.contact_id
 LEFT JOIN users users_civicrm_uf_match ON civicrm_uf_match.uf_id = users_civicrm_uf_match.uid
 LEFT JOIN og_uid users_civicrm_uf_match__og_uid ON users_civicrm_uf_match.uid = users_civicrm_uf_match__og_uid.uid
 WHERE (users_civicrm_uf_match__og_uid.is_admin not in ('0', '0')) AND (users_civicrm_uf_match__og_uid.nid = 759)
Here is the BROKEN query:
Code: [Select]
SELECT civicrm_contact.id AS id,
   civicrm_contact.display_name AS civicrm_contact_display_name,
   civicrm_contact.job_title AS civicrm_contact_job_title,
   civicrm_contact.home_URL AS civicrm_contact_home_URL
 FROM drupal_scethics.civicrm_contact civicrm_contact
 LEFT JOIN users users_ ON uf_id = users_.uid
 LEFT JOIN og_uid users___og_uid ON users_.uid = users___og_uid.uid
 WHERE users___og_uid.nid = 100

Is this an issue with an older version of civicrm?  The only other changed factor is that on the working site, the civi db is separate from the drupal db.  On the nonworking site all tables are in the same db.

I can attach views if requested.

mariagwyn

  • I post frequently
  • ***
  • Posts: 149
  • Karma: 4
  • CiviCRM version: CiviCRM 3.3.3
  • CMS version: Drupal 6.20
  • MySQL version: 5.2.14
  • PHP version: 5.0.91-50-log
Re: Unknown column 'uf_id' in 'on clause' query
August 04, 2009, 02:19:37 pm
I have now upgraded to 2.2.7, and the error still exists.  At a complete loss as to why it works perfectly on one site, but not on this site.  I don't see any changes in views.inc....

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Unknown column 'uf_id' in 'on clause' query
August 05, 2009, 03:18:20 am
hasn't there been some discussion on here about drupal databases with prefixes causing this problem - maybe search prefix for solution? or maybe you have already been down that route
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

mariagwyn

  • I post frequently
  • ***
  • Posts: 149
  • Karma: 4
  • CiviCRM version: CiviCRM 3.3.3
  • CMS version: Drupal 6.20
  • MySQL version: 5.2.14
  • PHP version: 5.0.91-50-log
Re: Unknown column 'uf_id' in 'on clause' query
August 05, 2009, 07:31:45 am
the databases are combined, but the table names are exactly the same as they would be if separate.

mariagwyn

  • I post frequently
  • ***
  • Posts: 149
  • Karma: 4
  • CiviCRM version: CiviCRM 3.3.3
  • CMS version: Drupal 6.20
  • MySQL version: 5.2.14
  • PHP version: 5.0.91-50-log
Re: Unknown column 'uf_id' in 'on clause' query
August 05, 2009, 04:50:01 pm
this error has disappeared with an upgrade to 2.2.8.  yea!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Unknown column 'uf_id' in 'on clause' query

This forum was archived on 2017-11-26.