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) »
  • Discussion (deprecated) »
  • CiviCRM Jobs (Moderator: Dave Greenberg) »
  • Paid help for Drupal Views -> Civicrm issue(s)
Pages: [1]

Author Topic: Paid help for Drupal Views -> Civicrm issue(s)  (Read 2999 times)

nimzie

  • I post occasionally
  • **
  • Posts: 85
  • Karma: 1
Paid help for Drupal Views -> Civicrm issue(s)
September 18, 2012, 12:26:19 pm
I've followed the views integration piece for my site, and the general basis of views / civicrm is working. When I start adding relationships to my view, I get errors. Not sure I'm doing this right.

Would like to pay someone for some of their time to help me fix this issue, and pave the way towards me being able to build some powerful views. Just getting my head around what's not working right now would be quite helpful. More work would likely come from this initial piece.

I can be reached at adam(at)shorelineconsulting(dot)ca

thank you,
adam

current issue:

Error message
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'civicrm_contact.contact_id' in 'on clause'

SQL:
SELECT civicrm_contact.id AS id, civicrm_contribution_civicrm_contact__civicrm_contact.first_name AS civicrm_contribution_civicrm_contact__civicrm_contact_first_, civicrm_contribution_civicrm_contact__civicrm_contact.id AS civicrm_contribution_civicrm_contact__civicrm_contact_id, civicrm_contact.last_name AS civicrm_contact_last_name
FROM
{civicrm_contact} civicrm_contact
LEFT JOIN {civicrm_contribution} civicrm_contribution_civicrm_contact ON civicrm_contact.contact_id = civicrm_contribution_civicrm_contact.id
LEFT JOIN {civicrm_contact} civicrm_contribution_civicrm_contact__civicrm_contact ON civicrm_contribution_civicrm_contact.contact_id = civicrm_contribution_civicrm_contact__civicrm_contact.id

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Paid help for Drupal Views -> Civicrm issue(s)
September 18, 2012, 02:09:27 pm
Quote from: nimzie on September 18, 2012, 12:26:19 pm
Not sure I'm doing this right.

Hopefully you can find someone to assist with this, but it would appear that you are doing it OK, and there is a bug in the code. We don't presently have anyone maintaining Views Integration for CiviCRM, but we are hoping that someone will fill that void soon.
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.

homebrewruss

  • I’m new here
  • *
  • Posts: 10
  • Karma: 0
  • CiviCRM version: 4.2
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Paid help for Drupal Views -> Civicrm issue(s)
October 09, 2012, 08:18:09 am
I'm seeing the same issue when using a CiviContribute relationship too.
As a workaround I've altered the SQL of the view in a drupal custom module as follows:


 /**
 * Implements hook_views_query_alter()
 */
function mycustommodule_views_query_alter(&$view, &$query) {
  // this is the name of our View and Display
  if ($view->name == 'membership_renewal_due' && $view->current_display == 'default') {
  //dpm($query);
      $query->table_queue['civicrm_contribution_civicrm_contact']['join']->left_field = 'id';
      $query->table_queue['civicrm_contribution_civicrm_contact']['join']->definition['left_field'] = 'id';
  }
}


This should work if you just change the function name to match your custom module and alter the view name and current display for your view.

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Paid help for Drupal Views -> Civicrm issue(s)
October 09, 2012, 09:13:21 am
If I look at your error message:
Quote
Column not found: 1054 Unknown column 'civicrm_contact.contact_id' in 'on clause'
It is actually right, the column should be 'civicrm_contact.id' and not 'civicrm_contact.contact_id'?
So I think your join should be
Code: [Select]
ON civicrm_contact.id = civicrm_contribution_civicrm_contact.idinstead of
Code: [Select]
ON civicrm_contact.contact_id = civicrm_contribution_civicrm_contact.id
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Lionsharz

  • I post occasionally
  • **
  • Posts: 76
  • Karma: 0
    • www.ulearnschool.com
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7
  • PHP version: 5.3 / 5.4
Re: Paid help for Drupal Views -> Civicrm issue(s)
August 21, 2013, 01:27:41 am
Is this still an issue with D7 and civi 4.2.0? I have those versions installed and the error began happening yesterday....
www.ulearnschool.com

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • CiviCRM Jobs (Moderator: Dave Greenberg) »
  • Paid help for Drupal Views -> Civicrm issue(s)

This forum was archived on 2017-11-26.