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 Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • I must have broken groups somehow... Help...
Pages: [1]

Author Topic: I must have broken groups somehow... Help...  (Read 490 times)

mneimeyer

  • I’m new here
  • *
  • Posts: 20
  • Karma: 1
I must have broken groups somehow... Help...
February 19, 2011, 08:48:10 pm
I just started working with Groups on a CiviCRM 3.3.1 install on Joomla 1.5.22 and I must have broken something. I cannot replicate this on the Demo site so... again... I must have broken something. Here's the process...

1. Do a quick search on "Smith" and pull up the 12 individuals that match...
2. Do "Add Contact to Group"
3. Either create a new one OR select an existing group
4. Success!
5. Go to either Contacts->Manage Groups->My Group->Contacts OR Search->Find Contacts->In... My Group
6. On the screen I see "DB Error: no such field"

If I do a view source I see the following SQL statement and a more specific error #1054 - Unknown column 'civicrm_group_contact-16.id' in 'field list'. Any ideas what I broke? I've searched this forum and the issue tracker and I think my terms are too generic because I'm not coming up with anything that seems relevant.

Thanks in advance!
Matt

SELECT DISTINCT(contact_a.id) as contact_id,
   contact_a.contact_type  as `contact_type`,
   contact_a.contact_sub_type  as `contact_sub_type`,
   contact_a.sort_name  as `sort_name`,
   contact_a.display_name  as `display_name`,
   contact_a.do_not_email  as `do_not_email`,
   contact_a.do_not_phone  as `do_not_phone`,
   contact_a.do_not_mail  as `do_not_mail`,
   contact_a.do_not_sms  as `do_not_sms`,
   contact_a.do_not_trade  as `do_not_trade`,
   contact_a.is_opt_out  as `is_opt_out`,
   contact_a.legal_identifier  as `legal_identifier`,
   contact_a.external_identifier  as `external_identifier`,
   contact_a.nick_name  as `nick_name`,
   contact_a.legal_name  as `legal_name`,
   contact_a.image_URL  as `image_URL`,
   contact_a.preferred_mail_format  as `preferred_mail_format`,
   contact_a.first_name  as `first_name`,
   contact_a.middle_name  as `middle_name`,
   contact_a.last_name  as `last_name`,
   contact_a.job_title  as `job_title`,
   contact_a.birth_date  as `birth_date`,
   contact_a.is_deceased  as `is_deceased`,
   contact_a.deceased_date  as `deceased_date`,
   contact_a.household_name  as `household_name`,
   IF ( contact_a.contact_type = 'Individual', NULL, contact_a.organization_name ) as organization_name,
   contact_a.sic_code  as `sic_code`,
   gender.value as gender_id,
   gender.label as gender,
   individual_prefix.value as individual_prefix_id,
   individual_prefix.label as individual_prefix,
   individual_suffix.value as individual_suffix_id,
   individual_suffix.label as individual_suffix,
   IF ( contact_a.contact_type = 'Individual', contact_a.organization_name, NULL ) as current_employer,
   civicrm_address.id as address_id,
   civicrm_address.street_address as `street_address`,
   civicrm_address.supplemental_address_1 as `supplemental_address_1`,
   civicrm_address.supplemental_address_2 as `supplemental_address_2`,
   civicrm_address.city as `city`,
   civicrm_address.postal_code_suffix as `postal_code_suffix`,
   civicrm_address.postal_code as `postal_code`,
   civicrm_address.geo_code_1 as `geo_code_1`,
   civicrm_address.geo_code_2 as `geo_code_2`,
   civicrm_state_province.id as state_province_id,
   civicrm_state_province.abbreviation as `state_province`,
   civicrm_state_province.name as state_province_name,
   civicrm_country.id as country_id,
   civicrm_country.name as `country`,
   civicrm_phone.id as phone_id,
   civicrm_phone.phone_type_id as phone_type_id,
   civicrm_phone.phone as `phone`,
   civicrm_email.id as email_id,
   civicrm_email.email as `email`,
   civicrm_email.on_hold as `on_hold`,
   civicrm_im.id as im_id,
   civicrm_im.provider_id as provider_id,
   civicrm_im.name as `im`,
   civicrm_worldregion.id as worldregion_id,
   civicrm_worldregion.name as `world_region`,
   `civicrm_group_contact-16`.id as group_contact_id,
   `civicrm_group_contact-16`.status as status
FROM civicrm_contact contact_a
   LEFT JOIN civicrm_address ON ( contact_a.id = civicrm_address.contact_id AND civicrm_address.is_primary = 1 )
   LEFT JOIN civicrm_state_province ON civicrm_address.state_province_id = civicrm_state_province.id
   LEFT JOIN civicrm_country ON civicrm_address.country_id = civicrm_country.id
   LEFT JOIN civicrm_email ON (contact_a.id = civicrm_email.contact_id AND civicrm_email.is_primary = 1)
   LEFT JOIN civicrm_phone ON (contact_a.id = civicrm_phone.contact_id AND civicrm_phone.is_primary = 1)
   LEFT JOIN civicrm_im ON (contact_a.id = civicrm_im.contact_id AND civicrm_im.is_primary = 1)
   LEFT JOIN civicrm_worldregion ON civicrm_country.region_id = civicrm_worldregion.id
   LEFT JOIN civicrm_option_group option_group_gender ON (option_group_gender.name = 'gender')
   LEFT JOIN civicrm_option_value gender
      ON (contact_a.gender_id = gender.value AND option_group_gender.id = gender.option_group_id)
   LEFT JOIN civicrm_option_group option_group_prefix ON (option_group_prefix.name = 'individual_prefix')
   LEFT JOIN civicrm_option_value individual_prefix
      ON (contact_a.prefix_id = individual_prefix.value AND option_group_prefix.id = individual_prefix.option_group_id )
   LEFT JOIN civicrm_option_group option_group_suffix ON (option_group_suffix.name = 'individual_suffix')
   LEFT JOIN civicrm_option_value individual_suffix
      ON (contact_a.suffix_id = individual_suffix.value AND option_group_suffix.id = individual_suffix.option_group_id )
WHERE  ( `civicrm_group_contact-16`.group_id IN ( 16 ) AND `civicrm_group_contact-16`.status IN ("Added") )
   AND (contact_a.is_deleted = 0)
ORDER BY contact_a.sort_name asc
LIMIT 0, 50 
« Last Edit: February 19, 2011, 08:49:58 pm by mneimeyer »

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: I must have broken groups somehow... Help...
February 20, 2011, 11:02:33 am
I don't understand why this is happening :-( since I've never seen a reference to a table name like that (civicrm_group_contact-N). I'm assuming 16 is the group ID of the group you created - but that still doesn't make sense, although it's likely some aliasing happening in the query construction.

Do you have any other extensions / components enabled in Joomla that might be interacting with CiviCRM?

You might try updating to 3.3.5 (the latest stable) and see if that helps.  You might also try truncating the cache tables (civicrm_cache and civicrm_group_contact_cache) and see if that cleans up the error (although it won't tell us how things got into this state).
Protect your investment in CiviCRM by  becoming a Member!

mneimeyer

  • I’m new here
  • *
  • Posts: 20
  • Karma: 1
Re: I must have broken groups somehow... Help...
February 21, 2011, 02:35:14 pm
I tried clearing the caches and no luck.

Here's an odd new piece of info... without realizing I was having issues someone used one of my groups in CiviMail and it worked fine... So now I'm really at a loss.

Matt

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • I must have broken groups somehow... Help...

This forum was archived on 2017-11-26.