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) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 3.1 Release Testing »
  • Custom fields for contact subtype not showing in views
Pages: [1] 2

Author Topic: Custom fields for contact subtype not showing in views  (Read 10786 times)

Triquanta

  • Guest
Custom fields for contact subtype not showing in views
January 13, 2010, 09:11:41 am
The custom types created for custom contact types are not visible in drupal views. I copied the information from http://euyo.triquanta.nl/civicrm/admin/setting/uf&reset=1 in settings.php but it is not working.

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: Custom fields for contact subtype not showing in views
January 13, 2010, 09:50:40 am

i suspect someone will need to go in and upgrade the views integration code to integrate and expose subtypes

if important to you/your org, please consider contributing a patch and/or sponsoring a developer to do the needed work

thanx

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

Triquanta

  • Guest
Re: Custom fields for contact subtype not showing in views
January 13, 2010, 12:09:11 pm
Ok. I am willing to look into it and see if I can make the necessary adjustments. Could you give me a pointer were to start? Because I am fairly new to Civi it will be a lot faster if you can give me some pointers. Thanks.

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: Custom fields for contact subtype not showing in views
January 13, 2010, 12:25:35 pm

u'll need to check and modify the file:

CIVICRM_ROOT/drupal/modules/views/civicrm.views.inc

function civicrm_views_custom_data_cache

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

Triquanta

  • Guest
Re: Custom fields for contact subtype not showing in views
January 13, 2010, 02:35:41 pm
After looking at the code I discovered that custom groups for subtypes were already implemented.
With some debugging I found that the value in civicrm_custom_group.extends_entity_column_value was not clean text. You can see this in the attached file. This seems to obstruct somehow the integration. If I change by hand a value to plain text (as you can see in the screenshot, I did) all the groups and fields are shown in the views EXCEPT for the changed group.
Waht should the value be in extends_entity_column_value? Where could it go wrong? Maybe CRM_Core_BAO_CustomGroup::getTree is not working as expected?

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: Custom fields for contact subtype not showing in views
January 13, 2010, 02:44:01 pm

extends_entity_column_value is a CTRL-A (octal 001) seperated value of text strings. the views part of the code should assume thats the format and interpret accordingly

can u elaborate on what u mean by getTree is not working as expected? does it not return the right set of values?

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

Triquanta

  • Guest
Re: Custom fields for contact subtype not showing in views
January 14, 2010, 01:20:18 am
Hmm, it seems that it had something to do with the cache. I deleted the template_c folder and now all the groups show up. Thanks for the help.

Triquanta

  • Guest
Re: Custom fields for contact subtype not showing in views
January 14, 2010, 01:38:42 am
Damn, cheered to early. I don't know what happened, but now it is not working anymore. I like to see if the error is in getTree, so we can narrow it down if it is in there or in  civicrm_views_custom_data_cache. What is a good way to debug this? I can't write anything to the screen because it is a hook.

Triquanta

  • Guest
Re: Custom fields for contact subtype not showing in views
January 14, 2010, 01:48:16 am
Ok, some more information. I used the dd function of the drupal devel module to see whats in the return value of getTree, and as you can see, only one group is returned. That is the one for Individuals. All the outher groups result in empty arrays.
Code: [Select]
civicrm_debug: Array
(
    [3] => Array
        (
            [id] => 3
            [name] => Status
            [table_name] => civicrm_value_status_3
            [title] => Status
            [help_pre] =>
            [help_post] =>
            [collapse_display] => 0
            [is_multiple] => 0
            [extends] => Contact
            [fields] => Array
                (
                    [3] => Array
                        (
                            [id] => 3
                            [label] => Email invalid
                            [column_name] => email_invalid_3
                            [data_type] => Boolean
                            [html_type] => Radio
                            [default_value] => 0
                            [is_required] => 0
                            [is_view] => 0
                            [date_format] => MdY
                        )

                    [4] => Array
                        (
                            [id] => 4
                            [label] => Address invalid
                            [column_name] => address_invalid_4
                            [data_type] => Boolean
                            [html_type] => Radio
                            [default_value] => 0
                            [is_required] => 0
                            [is_view] => 0
                            [date_format] => MdY
                        )

                    [5] => Array
                        (
                            [id] => 5
                            [label] => Last edited before import
                            [column_name] => last_edited_before_import_5
                            [data_type] => Date
                            [html_type] => Select Date
                            [is_required] => 0
                            [is_view] => 1
                            [date_format] => mm/dd/yy
                        )

                )

        )

    [info] => Array
        (
            [tables] => Array
                (
                    [civicrm_value_status_3] => Array
                        (
                            [email_invalid_3] => 1
                            [address_invalid_4] => 1
                            [last_edited_before_import_5] => 1
                        )

                )

            [select] => Array
                (
                    [0] => civicrm_value_status_3.id as civicrm_value_status_3_id
                    [1] => civicrm_value_status_3.entity_id as civicrm_value_status_3_entity_id
                    [2] => civicrm_value_status_3.email_invalid_3 as civicrm_value_status_3_email_invalid_3
                    [3] => civicrm_value_status_3.address_invalid_4 as civicrm_value_status_3_address_invalid_4
                    [4] => civicrm_value_status_3.last_edited_before_import_5 as civicrm_value_status_3_last_edited_before_import_5
                )

            [from] => Array
                (
                    [0] => civicrm_value_status_3
                )

            [where] =>
        )

)

civicrm_debug: Array
(
)

civicrm_debug: Array
(
)

civicrm_debug: Array
(
)

civicrm_debug: Array
(
)

civicrm_debug: Array
(
)

civicrm_debug: Array
(
)

civicrm_debug: Array
(
)

civicrm_debug: Array
(
)

Triquanta

  • Guest
Re: Custom fields for contact subtype not showing in views
January 14, 2010, 02:24:09 am
The query that is build in getTree does not yield results for subtypes because there is something wrong with the LIKE clause. The CTRL-A seperator is messing things up I guess. If I comment out line 321 ( $subType  = CRM_Core_DAO::VALUE_SEPARATOR . $subType . CRM_Core_DAO::VALUE_SEPARATOR;) I get all the fields and groups back. Is it necessary to use the  CRM_Core_DAO::VALUE_SEPARATOR in the LIKE clause?

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: Custom fields for contact subtype not showing in views
January 14, 2010, 11:02:34 am

yes

since there could be multiple subtypes which are delimited by the SEPARATOR

can you get on IRC, so we can get more details, investigate and potentially fix

thanx

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

Triquanta

  • Guest
Re: Custom fields for contact subtype not showing in views
January 19, 2010, 12:56:09 pm
At what times are you on IRC. I am in the Netherlands so there is a little time difference I guess? ;) Can you let me know when I have the most chance on speaking you there?

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: Custom fields for contact subtype not showing in views
January 19, 2010, 04:20:04 pm

with developers in poland/india/US we are pretty much around 24 hours :)

just pop on irc and ask someone for help and point to the forum topic to give folks a context.

i will not be around a lot this week since i'm travelling and doing a few traininings

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

davej

  • Ask me questions
  • ****
  • Posts: 404
  • Karma: 21
Re: Custom fields for contact subtype not showing in views
January 22, 2010, 10:46:25 am
Has there been any progress with this?

Thanks,

Dave J

irvken

  • I post occasionally
  • **
  • Posts: 47
  • Karma: 1
Re: Custom fields for contact subtype not showing in views
February 05, 2010, 04:32:28 am
I'm having problems with some of the core fields in a contact subtype record not being returned in Views either - Organsization name is exposed but returns no data when previewed!! Possibly related?

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 3.1 Release Testing »
  • Custom fields for contact subtype not showing in views

This forum was archived on 2017-11-26.