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) »
  • Error from CiviContacts in View
Pages: [1]

Author Topic: Error from CiviContacts in View  (Read 2425 times)

jvansickle

  • Guest
Error from CiviContacts in View
September 29, 2009, 09:08:29 am
I am getting an error when trying to add custom data field I created for CiviContacts to a View.  The View works fine when using out of the box fields for CiviContacts.  However, when I start adding the custom fields, the View stops returning data and gives me the following error:

Quote
Error: handler for civicrm_value_voter_information_1 > precinct_8 doesn't exist!

This error happens when adding the custom field to Filter, Sort, Fields, or other sections of the View.

CiviCRM 2.2.5
Drupal 6.12
Views 6.x-2.6

I would greatly appreciate any assistance or suggestions.

-James

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Error from CiviContacts in View
September 29, 2009, 12:18:25 pm
James - check this documentation....

http://wiki.civicrm.org/confluence/display/CRMDOC/Views2+Integration+Module

...particularly including this:
"If you create a new table - e.g. by creating a new custom data group - it won't be available to Views until it has been added to your settings.php file * . See that 'civicrm_value_meal_preferences_1' in the example below is a table representing a custom data group."

Also there's been quite a lot of improvements, bug fixes etc contributed for Views integration over the past few release cycles - so consider upgrading (3.0 stable s/b released this week).
Protect your investment in CiviCRM by  becoming a Member!

8ballsaysiwin@gmail.com

  • Guest
Re: Error from CiviContacts in View
October 09, 2009, 03:03:05 pm
I am getting this same error with my custom field when I put it in "sort".

Code: [Select]
Error: handler for civicrm_value_pledge_results_2 > total_calls_made_10 doesn't exist!
I have it in fields and it works correctly there. The field is an integer and I would like to sort by total_calls_made_10.

I am running drupal 6.14 and civicrm 3.0.0 and the most recent version of views.

Any suggestions for where to look?

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: Error from CiviContacts in View
October 09, 2009, 03:09:50 pm

the views integration code is here: drupal/modules/views/
the handlers are defined here: drupal/modules/views/civicrm/

I suspect u'll have to change the handler/filter definition for the custom fields based on their type

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

8ballsaysiwin@gmail.com

  • Guest
Re: Error from CiviContacts in View
October 10, 2009, 09:34:21 am
Ok thanks. I'll look there and see what I can find.

Also, could it be a problem with the database schema of some sort?

I tried to write a custom block with the following code:

Code: [Select]
<?php
db_set_active
('civicrm');

$sql = "SELECT cvp.entity_id, cvp.total_calls_made_10, cc.display_name FROM {civicrm_value_pledge_results_2} AS cvp LEFT JOIN {civicrm_contact} AS cc ON cc.id=cvp.entity_id WHERE cvp.total_calls_made_10 IS NOT NULL SORT BY cvp.total_calls_made_10 ASC LIMIT 0, 10";

$result = db_query($sql);
echo 
"<ol>";
while (
$row = db_fetch_array($result)) {
      echo 
"<li> ";
      echo 
$row['display_name'];
      echo 
" -- ";
      echo 
$row['total_calls_made_10'];
      echo 
"</li>";
      echo 
"<br />";
}
echo 
"</ol>";
db_set_active('default');
?>

and i get this error:

Quote
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SORT BY total_calls_made_10 ASC LIMIT 0, 10' at line 1 query: SELECT cvp.entity_id, cvp.total_calls_made_10, cc.display_name FROM callscrm.civicrm_value_pledge_results_2 AS cvp LEFT JOIN callscrm.civicrm_contact AS cc ON cc.id=cvp.entity_id WHERE cvp.total_calls_made_10 IS NOT NULL SORT BY cvp.total_calls_made_10 ASC LIMIT 0, 10 in /home/miadmin/public_html/includes/common.inc(1685) : eval()'d code on line 6.


BUT, as soon as I take out the
Code: [Select]
SORT BY cvp.total_calls_made_10 ASC it works just fine. (Though obviously not sorted).

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: Error from CiviContacts in View
October 10, 2009, 10:18:17 am

for mysql errors, it does help to check the mysql documentation and check the syntax

change SORT BY to ORDER BY

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Error from CiviContacts in View

This forum was archived on 2017-11-26.