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 'civicrm_contact.group' - willing to pay
Pages: [1]

Author Topic: Unknown column 'civicrm_contact.group' - willing to pay  (Read 1531 times)

drewpal

  • I’m new here
  • *
  • Posts: 14
  • Karma: 0
  • CiviCRM version: 3.4, 4.0
  • CMS version: Drupal, Joomla
  • MySQL version: 5.0.77
  • PHP version: PGP 5.3.8
Unknown column 'civicrm_contact.group' - willing to pay
June 13, 2012, 11:53:24 pm
I am willing to pay to get this issue sorted out with a patch to views files in a drupal install running civicrm 4.2.2 and drupal 7.

I have created a view (user) listing certain contact fields. I need to set it up this way so that I can access as many civicrm tables as I can as selecting civicrm types of content as opposed to users limits fields I can select (eg no access to some paticipant/events tables when in a civicrm contacts view).
Is there a way to simply create a civicrm general view that combines drupal users, contacts, participants, events, without having to limit tables available?
This would work perfectly for me and I'm sure others as well.
Failing that, my problem right now is that I need to access the civicrm groups field category from the users view. The field is there but simply does not work. I see it has previously been mentioned at for example:
http://forum.civicrm.org/index.php?topic=22475.0
In this case, Lobo suggested:
Quote
all the views integration code is under: drupal/modules/views/

your best bet would be to track it from there and trace whats happening.

When one tries to add the civicrm Group field (The same happens with Tags), the following error results:

Code: [Select]
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'civicrm_contact.group' in 'field list'

The reason is there is no field 'group' in the civicrm_contact table.

The resulting query (in my case) is:

Code: [Select]
SELECT DISTINCT users.name AS users_name, users.uid AS uid, civicrm_participant.id AS civicrm_participant_id, civicrm_contact.first_name AS civicrm_contact_first_name, civicrm_contact.id AS civicrm_contact_id, civicrm_contact.last_name AS civicrm_contact_last_name, users.mail AS users_mail, civicrm_value_event_rideshare_16.rideshare_options_61 AS civicrm_value_event_rideshare_16_rideshare_options_61, civicrm_value_event_rideshare_16.share_point_62 AS civicrm_value_event_rideshare_16_share_point_62, civicrm_participant.register_date AS civicrm_participant_register_date, civicrm_address.city AS civicrm_address_city, civicrm_address2.postal_code AS civicrm_address2_postal_code, civicrm_contact.group AS civicrm_contact_group
FROM
{users} users
LEFT JOIN {civicrm_uf_match} civicrm_uf_match ON users.uid = civicrm_uf_match.uf_id
LEFT JOIN {civicrm_participant} civicrm_participant ON civicrm_uf_match.contact_id = civicrm_participant.contact_id
LEFT JOIN {civicrm_contact} civicrm_contact ON civicrm_uf_match.contact_id = civicrm_contact.id
LEFT JOIN {civicrm_value_event_rideshare_16} civicrm_value_event_rideshare_16 ON civicrm_contact.id = civicrm_value_event_rideshare_16.entity_id
LEFT JOIN {users_roles} users_roles_value_0 ON users.uid = users_roles_value_0.uid AND users_roles_value_0.rid = '6'
LEFT JOIN {civicrm_address} civicrm_address ON civicrm_uf_match.contact_id = civicrm_address.contact_id AND civicrm_address.is_primary = '1'
LEFT JOIN {civicrm_address} civicrm_address2 ON civicrm_uf_match.contact_id = civicrm_address2.contact_id AND civicrm_address2.is_primary = '1'
WHERE (( (civicrm_participant.status_id IN  ('1', '5', '6')) AND (civicrm_value_event_rideshare_16.rideshare_options_61 IN  ('need', 'offer', 'both', 'cannot')) AND( (users_roles_value_0.rid = '6') )))
ORDER BY civicrm_participant_register_date DESC

Everything works fine if I can just get this group field to work so I can filter by it and in that way, know which group the user/contact belongs in.

If only the civicrm Group category could correctly pull in group names and group ID's.
Again, I'm willing to pay for this.
Cheers.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Unknown column 'civicrm_contact.group' - willing to pay
June 14, 2012, 06:11:55 am
My presumption is that Lobo's response was based on the fact that there is no one (AFAIK) available at present to maintain the Views integration code for CiviCRM. That said, hopefully someone will step up and offer to fix this for you, whether for a fee or not.

You may want to consider posting for paid work in the Professional CiviCRM Services forum or on the Drupal forums.
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.

drewpal

  • I’m new here
  • *
  • Posts: 14
  • Karma: 0
  • CiviCRM version: 3.4, 4.0
  • CMS version: Drupal, Joomla
  • MySQL version: 5.0.77
  • PHP version: PGP 5.3.8
Re: Unknown column 'civicrm_contact.group' - willing to pay
June 14, 2012, 06:32:35 am
OK, thanks Hershel,
If it does get fixed I'll post whatever patch back here.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Unknown column 'civicrm_contact.group' - willing to pay
June 14, 2012, 07:55:40 am

Might want to contact web access india from the professional list and see if they can take a look and fix / improve the views integration including the group stuff

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

sonicthoughts

  • Ask me questions
  • ****
  • Posts: 498
  • Karma: 10
Re: Unknown column 'civicrm_contact.group' - willing to pay
August 07, 2012, 02:40:14 pm
Hi Drewpal - were you able to make any progress on views integration?

drewpal

  • I’m new here
  • *
  • Posts: 14
  • Karma: 0
  • CiviCRM version: 3.4, 4.0
  • CMS version: Drupal, Joomla
  • MySQL version: 5.0.77
  • PHP version: PGP 5.3.8
Re: Unknown column 'civicrm_contact.group' - willing to pay
August 15, 2012, 04:04:03 pm
Hey sonicthoghts,
Apologies, been a while since I last checked in here.
Yes and No.
No, for getting views coded.
Yes on a solution.

I realised that as far as events were concerned, the information that was important to me was the events that were active (or had been) and therefore had participants.
So, I could simply link the participants database tables to the events database using relationships in drupal.

For my setup then:
1. Views table holding participants (started off with just the participant ID as the only field)
2. Three relationships:
    a) CiviCRM Participants: Participant's Contact ID (relationship set as not required)
    b) CiviCRM Participants: Event ID (not required)
    c) CiviCRM Contacts: Drupal ID (this you'd probably only need if working with say profile2)

I am then able to get all fields related to the participant, events, profiles etc. I can access all custom data associated with the participant and events.
I built an exposed search for event names, event ID.

This solves my original problem of displaying contact information for events such as custom fields for each user that change for each specific event. In this case it was for rideshare options and locations.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Unknown column 'civicrm_contact.group' - willing to pay

This forum was archived on 2017-11-26.