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) »
  • Views & Contact->Tags: Unknown column 'civicrm_contact.tag' in 'field list'
Pages: [1]

Author Topic: Views & Contact->Tags: Unknown column 'civicrm_contact.tag' in 'field list'  (Read 3774 times)

bouton

  • Guest
Views & Contact->Tags: Unknown column 'civicrm_contact.tag' in 'field list'
November 17, 2011, 05:21:36 am
I have built a view which works fine.  I can view it no problem, getting a list of contacts and their addresses just fine

I then added contact->tags to the view and get this error message

Code: [Select]
Column not found: Unknown column 'civicrm_contact.tag' in 'field list'I am using Drupal 7.9 and Civicrm 4.0.7

When I add Tags->tag it adds one tag just fine. But the whole address then repeats for every diff tag - not what I want.

I looked through civicrm.views.inc and I can't see anywhere obvious to fix it. Nothing in the bugs list either.

Anyone with any suggestions?
Thanks

DerekL

  • I post frequently
  • ***
  • Posts: 132
  • Karma: 1
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.1.54
  • PHP version: 5.2.17
Re: Views & Contact->Tags: Unknown column 'civicrm_contact.tag' in 'field list'
December 13, 2011, 12:08:02 am
Same Issue here.  Drupal 7.10 Civi 4.1alpha2

DerekL

  • I post frequently
  • ***
  • Posts: 132
  • Karma: 1
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.1.54
  • PHP version: 5.2.17
Re: Views & Contact->Tags: Unknown column 'civicrm_contact.tag' in 'field list'
December 13, 2011, 02:13:41 am
Amazingly sweet workaround:

Prep a view block containing the data you want, then use:

<?php      
$block = module_invoke('views', 'block_view', 'primary_member_block-block');
print render($block);
?>

In your template. This is actually easier than working with $row and $field in the tpls, dont know about performance though.

narayanis

  • I post occasionally
  • **
  • Posts: 56
  • Karma: 2
Re: Views & Contact->Tags: Unknown column 'civicrm_contact.tag' in 'field list'
March 12, 2012, 03:47:32 pm
I can confirm this behavior on D7.9 and CiviCRM 4.1.1. I'm currently working around it by using CiviCRM Tags: Tag ID and using my tag ID. If you need multiple tags to do a 'one of' query, you must use Views Filter Groups and add the desired tag IDs one by one, then stick them into a filter group together.

The feature for Tag: Names was working on my system previously, which I believe was v4.0.3.
« Last Edit: March 12, 2012, 03:49:53 pm by narayanis »

torrance123

  • I post occasionally
  • **
  • Posts: 57
  • Karma: 3
  • CiviCRM version: 4.0
  • CMS version: Drupal 7
  • MySQL version: 5.0.91
  • PHP version: 5.3.3
Re: Views & Contact->Tags: Unknown column 'civicrm_contact.tag' in 'field list'
November 05, 2012, 03:13:40 pm
Just looking at the views code, I fail to see how Tag(s) ever worked (as well as Note(s) and Group(s)).

All three of these are being exported in CRM/Contact/BAO/Contact.php by the static method exportableFields().

The 'fix' right now would be to exclude these fields from being added to views, and this should be done by either:

1. fixing the exportableFields() method from exporting tags, notes and groups OR
2. adding tags, groups and notes to the 'skipfields' array in line ~562 of drupal/modules/views/components/civicrm.core.inc

Can a core Civicrm developer please indicate which of these to do (I don't understand what else exportableFields() is being used for) and then I can work up a patch.

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: Views & Contact->Tags: Unknown column 'civicrm_contact.tag' in 'field list'
November 05, 2012, 04:43:21 pm

exportableFields is used to indicate what fields can be exported/imported/used in profiles. Hence we should not alter that function.

seems like this should go into the skipFields array.

But being able to use views for notes / groups / tags would indeed be a nice feature. If you can see how we can add it for this version that would be great

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

Barnacle

  • I post occasionally
  • **
  • Posts: 62
  • Karma: 2
    • White Fuse Media
  • CiviCRM version: 4.4
  • CMS version: Drupal 7
  • MySQL version: 5.x
  • PHP version: 5.3
Re: Views & Contact->Tags: Unknown column 'civicrm_contact.tag' in 'field list'
May 31, 2013, 07:35:26 am
Did this ever get fixed? I ran into the same problem today. Is it just currently impossible to show contact tags in a Drupal view? How hard would it be to add this functionality?
--
http://whitefusemedia.com/

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Views & Contact->Tags: Unknown column 'civicrm_contact.tag' in 'field list'

This forum was archived on 2017-11-26.