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) »
  • Unable to add CCK CiviCRM Contact Filter in Views
Pages: [1]

Author Topic: Unable to add CCK CiviCRM Contact Filter in Views  (Read 2999 times)

Manonline

  • Guest
Unable to add CCK CiviCRM Contact Filter in Views
January 20, 2010, 09:55:23 am
Hi all, I'm trying to add a CiviCRM Contact filter in a Node View but it gives me this error:

An error occurred at http://civicrm.terromeonline.com.ar/admin/build/views/ajax/add-item/casetracker_project_cases/default/filter.

Any clue?

I'm able to add CiviCRM fields and arguments, but not filters.

thanks in advance and sorry for my english :)

jalama

  • I post frequently
  • ***
  • Posts: 176
  • Karma: 22
    • Rooty Hollow LLC
  • CiviCRM version: 3.3.5
  • CMS version: Drupal 6 and 7
  • MySQL version: 5.1
  • PHP version: 5.2.5 and 5.3
Re: Unable to add CCK CiviCRM Contact Filter in Views
January 20, 2010, 11:38:12 am
You English is fine :).

the error your getting is quite odd since filters are a pretty big part of Views.  Do you have the $db_prefix variable set to include the CiviCRM table sin settings.php?

If so can you export your view and attach it here?  Also, let me know what language you are using.
http://www.rootyhollow.com

Manonline

  • Guest
Re: Unable to add CCK CiviCRM Contact Filter in Views
January 20, 2010, 01:26:39 pm
I have different databases for Drupal and CiviCRM. Both uses the same user with full access (root). Drupal tables aren't prefixed and I have added the CiviCRM prefixes in Drupal settings.php from the CiviCRM administration pages ("civicrm." for all tables).

I don't have the View export code here, but the error occurs in a new view too by trying to add a CiviCRM Contact filter.

jalama

  • I post frequently
  • ***
  • Posts: 176
  • Karma: 22
    • Rooty Hollow LLC
  • CiviCRM version: 3.3.5
  • CMS version: Drupal 6 and 7
  • MySQL version: 5.1
  • PHP version: 5.2.5 and 5.3
Re: Unable to add CCK CiviCRM Contact Filter in Views
January 20, 2010, 04:26:47 pm
So I can't reproduce the issue at all, Are you able to create node views?

What language are you using?
http://www.rootyhollow.com

Manonline

  • Guest
Re: Unable to add CCK CiviCRM Contact Filter in Views
January 20, 2010, 04:59:30 pm
Yes, I'm able to create node views. The error occurs only when I try to add CiviCRM Contact filter. I can add Node: Title filter, and all other filters.

With language did you mean to interface language? I'm using english in CiviCRM and spanish in Drupal (Spanish translations in CiviCRM are very pooooor)

jalama

  • I post frequently
  • ***
  • Posts: 176
  • Karma: 22
    • Rooty Hollow LLC
  • CiviCRM version: 3.3.5
  • CMS version: Drupal 6 and 7
  • MySQL version: 5.1
  • PHP version: 5.2.5 and 5.3
Re: Unable to add CCK CiviCRM Contact Filter in Views
January 20, 2010, 05:37:58 pm
hmmm...

I'm sort of stumped on this one.

Can you dump out a list of the modules you are using?

THough I just read the title of the post, how are you using CCK?
http://www.rootyhollow.com

Manonline

  • Guest
Re: Unable to add CCK CiviCRM Contact Filter in Views
January 20, 2010, 06:10:23 pm
Drupal 6.15
Views 2.8
CCK 6.x-3.x-dev (2009-Dic-29)
Case Tracker 6.x-1.0-beta4 (because CiviCase doesn't fits me or because I don't understand it)

CiviCRM 3.0
CiviCRM CCK Contact Reference


I need a CRM for the commercial area in the company where I work, and a ticketing system for the technical support area. We was using another CRM (hired) and no ticketing system. I don't know all CiviCase component, but I think that it doesn't fit our needs, so I decided to use "Case Tracker" module who treats cases as nodes. This fits our needs, but I need to make a relation behind the issue and a client or contact loaded by the commercial area.

Because of that I have added the CiviCRM Contact Reference field to the issue content type used by Case Tracker.

I have a view with all fields I need to show, including the CiviCRM Contact, and I need to find cases (issues) filtering by the client (CiviCRM Contact), but I can't add this filter :(

jalama

  • I post frequently
  • ***
  • Posts: 176
  • Karma: 22
    • Rooty Hollow LLC
  • CiviCRM version: 3.3.5
  • CMS version: Drupal 6 and 7
  • MySQL version: 5.1
  • PHP version: 5.2.5 and 5.3
Re: Unable to add CCK CiviCRM Contact Filter in Views
January 20, 2010, 06:27:46 pm
okay now I get it.  Your navigating uncharted waters here, the CCK integration is a little experimental still.  I'll look at it and get back to you on this thread.
http://www.rootyhollow.com

Manonline

  • Guest
Re: Unable to add CCK CiviCRM Contact Filter in Views
January 21, 2010, 06:21:48 am
I read about that in posts from year 2008... I thought CCK integration was finished. But I'm wrong heheh.

I'm not a PHP programmer, but I think the problem maybe is in the filter handlers. If I hack the CCK CiviCRM Contact Reference module deleting the last lines where the module call the views filter handler function, Views throw me an other error, something like "Can't found contact_id". And I couldn't found the variable contact_id, contact_something or something related to CiviCRM in the filter handler included in the module.

I repeat, I'm not a PHP programmer :P

jalama

  • I post frequently
  • ***
  • Posts: 176
  • Karma: 22
    • Rooty Hollow LLC
  • CiviCRM version: 3.3.5
  • CMS version: Drupal 6 and 7
  • MySQL version: 5.1
  • PHP version: 5.2.5 and 5.3
Re: Unable to add CCK CiviCRM Contact Filter in Views
January 21, 2010, 06:28:14 am
You're right, nice sloothing.  I need to look at how that's done with other CCK modules and see if we can imitate it :)
http://www.rootyhollow.com

Manonline

  • Guest
Re: Unable to add CCK CiviCRM Contact Filter in Views
January 21, 2010, 11:31:45 am
Maybe looking for the handler from the Node Reference or User Reference module (from CCK core)...

ThreeSixFourNine

  • Guest
Re: Unable to add CCK CiviCRM Contact Filter in Views
February 01, 2010, 05:50:28 am
Same problem here.

I've been hacking away to see what I can see and have come up with the following:

Apache was complaining about the two Protected variables in civicrm_cck/civicrm_cck_handler_filter.inc to begin with:

Code: [Select]
PHP Fatal error:  Access level to civicrm_cck_handler_filter::$content_field must be public (as in class content_handler_filter_many_to_one) in sites/all/modules/civicrm/drupal/modules/civicrm_cck/civicrm_cck_handler_filter.inc on line 87

Set them to Public to see what that did, and then got

Code: [Select]
PHP Fatal error:  Call to undefined function cckcivirelate_allowed_values() in sites/all/modules/civicrm/drupal/modules/civicrm_cck/civicrm_cck_handler_filter.inc on line 21

Which appears to be correct, since the only place I can find that function is listed, is in that call. There's a civicrm_cck_allowed_values() function in the .module, so I've switched that in, and and progressed to:

Code: [Select]
PHP Fatal error:  Unsupported operand types in includes/common.inc on line 2876

Refreshing the Views UI page after failing to add the filter brings back this bad boy:

Code: [Select]


    * warning: Cannot use a scalar value as an array in includes/form.inc on line 892.
    * warning: Cannot use a scalar value as an array in includes/form.inc on line 893.
    * warning: Cannot use a scalar value as an array in includes/form.inc on line 896.
    * warning: Cannot use a scalar value as an array in includes/form.inc on line 908.
    * warning: Cannot use a scalar value as an array in includes/form.inc on line 911.
    * warning: Cannot use a scalar value as an array in includes/form.inc on line 916.
    * warning: Cannot use a scalar value as an array in includes/form.inc on line 865.
    * warning: Cannot use a scalar value as an array in includes/form.inc on line 884.
    * warning: Cannot use a scalar value as an array in includes/form.inc on line 887.
    * warning: Cannot use a scalar value as an array in includes/form.inc on line 892.
    * warning: Cannot use a scalar value as an array in includes/form.inc on line 893.
    * warning: Cannot use a scalar value as an array in includes/form.inc on line 896.
    * warning: Cannot use a scalar value as an array in includes/form.inc on line 908.
    * warning: Cannot use a scalar value as an array in includes/form.inc on line 911.
    * warning: Cannot use a scalar value as an array in includes/form.inc on line 916.
    * warning: Cannot use a scalar value as an array in includes/form.inc on line 923.
    * warning: uasort() [function.uasort]: The argument should be an array in includes/common.inc on line 2874.


But given the allowed_values() function *appears* to spit back an array, I'm at a loss from here on.. I'm going to keep hacking away, but if someone with some clue could take a look I'd appreciate it.

(Paths have all been changed to be relative from the site root since I'm an über paranoid kind of guy).

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Unable to add CCK CiviCRM Contact Filter in Views

This forum was archived on 2017-11-26.