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 »
  • Edit drupal account - custom fields for contact subtype not showing
Pages: [1]

Author Topic: Edit drupal account - custom fields for contact subtype not showing  (Read 2013 times)

Triquanta

  • Guest
Edit drupal account - custom fields for contact subtype not showing
January 14, 2010, 02:30:37 am
The custom fields used for a contact subtype don't show up on the edit screens of a drupal user account.

I made a custom contact subtype based on Individual.
I made a custom group and added some custom fields, that are used for the subtype.
I made a profile and checked "View/Edit Drupal User Account".
I the fields from the custom group used for the contact subtype.

Did I forget something? Can someone point me out where those fields are rendered so that I can debug this?

Deepak Srivastava

  • Ask me questions
  • ****
  • Posts: 677
  • Karma: 65
Re: Edit drupal account - custom fields for contact subtype not showing
January 14, 2010, 07:12:44 am
Profile extending subtypes for "user account" wasn't supported. Did some research today and came out that the fix is pretty trivial. Apply the following patch to get it working (or wait for upcoming release).

Code: [Select]
Index: CRM/Core/BAO/UFGroup.php
===================================================================
--- CRM/Core/BAO/UFGroup.php (revision 25884)
+++ CRM/Core/BAO/UFGroup.php (working copy)
@@ -549,6 +549,10 @@
                 if ( $ctype ) {
                     require_once 'CRM/Core/BAO/UFField.php';
                     $profileType = CRM_Core_BAO_UFField::getProfileType( $profileID );
+                    if ( CRM_Contact_BAO_ContactType::isaSubType( $profileType ) ) {
+                        $profileType = CRM_Contact_BAO_ContactType::getBasicType( $profileType );
+                    }
+
                     if ( ( $profileType != 'Contact' ) && ( $profileType != $ctype ) ) {
                         return null;
                     }

thanks for the heads up :)
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

Triquanta

  • Guest
Re: Edit drupal account - custom fields for contact subtype not showing
January 15, 2010, 01:23:39 am
Thanks, applied the patch and it is working now.

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

This forum was archived on 2017-11-26.