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) »
  • CiviCRM Views Issue - Generating Wrong SQL
Pages: [1]

Author Topic: CiviCRM Views Issue - Generating Wrong SQL  (Read 899 times)

annaleevk

  • I post occasionally
  • **
  • Posts: 87
  • Karma: 3
  • Carpe Noctem!
    • Women in Development, New York
  • CiviCRM version: 3.4.5
  • CMS version: Drupal 6.22
  • MySQL version: 5.1.48
  • PHP version: 5.2.14
CiviCRM Views Issue - Generating Wrong SQL
August 13, 2011, 09:53:09 am
This has been a problem since 3.4.2 thru 3.4.5.  Creating a CiviCRM view containing 2 custom fields.  One is a Description field, the other is a multi-select field.  Hershel had to create a custom template to get around the problem.

Here is the sql that is being generated and the dialog with Hershel about the problem.

user warning: Unknown column 'civicrm_contact.custom_16' in 'field list' query: SELECT civicrm_membership.id AS 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, civicrm_contact.organization_name AS civicrm_contact_organization_name, civicrm_contact.custom_16 AS civicrm_contact_custom_16, civicrm_contact.custom_15 AS civicrm_contact_custom_15 FROM `widny_civicrm`.civicrm_membership civicrm_membership LEFT JOIN `widny_civicrm`.civicrm_contact civicrm_contact ON civicrm_membership.contact_id = civicrm_contact.id LIMIT 0, 10 in /home/widny/www/www/sites/all/modules/views/includes/view.inc on line 771.

From Hershel:

These two fields:
CiviCRM Contacts: Organization Description
CiviCRM Contacts: Advertiser Categories
are causing the problem. Views is using the API format for custom fields instead of the SQL format. I have no idea why. the SQL is not JOINing civicrm_value_resource_directory_info_4 and I don't know why.

Is anyone else having this issue?

Annalee Van Kleeck
Lyric Systems, LLC
201 951.8711
annalee@lyricsystems.com

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: CiviCRM Views Issue - Generating Wrong SQL
August 13, 2011, 11:21:01 am
I think this is the relevant ticket

http://issues.civicrm.org/jira/browse/CRM-8481
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

annaleevk

  • I post occasionally
  • **
  • Posts: 87
  • Karma: 3
  • Carpe Noctem!
    • Women in Development, New York
  • CiviCRM version: 3.4.5
  • CMS version: Drupal 6.22
  • MySQL version: 5.1.48
  • PHP version: 5.2.14
Re: CiviCRM Views Issue - Generating Wrong SQL
August 13, 2011, 12:56:10 pm
Is there a patch for 3.4.5?
Annalee Van Kleeck
Lyric Systems, LLC
201 951.8711
annalee@lyricsystems.com

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • CiviCRM Views Issue - Generating Wrong SQL

This forum was archived on 2017-11-26.