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 Profiles (Moderator: Dave Greenberg) »
  • website field
Pages: [1]

Author Topic: website field  (Read 1429 times)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
website field
January 11, 2010, 01:14:33 pm
Hello,

I'm a bit confused. I want to create a search profile with some basic fields - display name, image & website including individuals & organisations from a group but this turns out not to be straight forward.

The website field is available as an individual field & as an organisation field but not as a contact field so I can have one or the other. Display name is automatically added but not as a searchable field and I don't seem to be able to add it.
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

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: website field
January 11, 2010, 08:33:01 pm

website field should be listed as a contact field and not indiv/organization. if you file an issue and a patch, we can get it included in 3.2

the display name is automatically added for all profiles. adding that as an optional field along with making it searchable would be another good profile addition. Wanna contribute a patch for this too?

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

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: website field
January 12, 2010, 02:03:13 am
It seems to me that around line 745 of CRM_Contact_BAO_Contact an array is defined which says that the home_url is not applicable to household and this is why it doesn't appear to be of type 'contact'. If we agree that households can have websites (which seems reasonable to me) simply removing home_url as highlighted below does it



Code: [Select]
                    //unset the fields, which are not related to their
                    //contact type.
                    $commonValues = array ( 'Individual'   => array( 'household_name','legal_name','sic_code','organization_name' ),
                                            'Household'    => array( 'first_name','middle_name','last_name','job_title',
                                                                     'gender_id','birth_date','organization_name','legal_name',
                                                                     'legal_identifier','sic_code',[b]'home_URL',[/b]'is_deceased',
                                                                     'deceased_date' ),
                                            'Organization' => array( 'first_name','middle_name','last_name','job_title',
                                                                     'gender_id','birth_date','household_name','email_greeting',
                                                                     'email_greeting_custom','postal_greeting',
                                                                     'postal_greeting_custom','is_deceased','deceased_date' )
                                            );
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: website field
January 12, 2010, 02:14:16 am
I'm now really confused. I took a look to see the other code in the area and references to  CRM_Contact_DAO_Contact were everywhere - but it doesn't exist. And hasn't for some time.

http://fisheye2.atlassian.com/browse/CiviCRM/trunk/CRM/Contact/DAO

So, what are the code references below calling?

Code: [Select]
[quote]require_once 'CRM/Contact/DAO/Contact.php';
class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact
                $fields = CRM_Contact_DAO_Contact::import( );[/quote]

Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

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: website field
January 12, 2010, 08:09:25 am

the DAO files are generated from the xml files and are not stored in svn

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

hlevinson

  • I post occasionally
  • **
  • Posts: 53
  • Karma: 3
Re: website field
January 12, 2010, 03:29:55 pm
I think this is the same or a related problem: 

When I use the API function civicrm_contact_add to add a new Organization, even though I supply the home_url field it doesn't get saved.

Lobo -- were you suggesting I need to edit an XML file somewhere?

I edited my CRM/Contact/BAO/Contact.php and removed the references to home_url but it didn't help.

If I know where to make the fix I can prepare a patch.

thanks,
Harry

Yashodha Chaku

  • Forum Godess / God
  • Ask me questions
  • *****
  • Posts: 755
  • Karma: 57
    • CiviCRM
Re: website field
January 13, 2010, 07:04:14 am
hlevinson :
Quote
even though I supply the home_url field it doesn't get saved.

Could you try using home_URL instead of home_url.

HTH
-Yashodha
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

hlevinson

  • I post occasionally
  • **
  • Posts: 53
  • Karma: 3
Re: website field
January 13, 2010, 01:52:40 pm
Thanks so much... indeed it seemed like a problem with the case in some places in my code.

The data is now being saved OK.

Harry

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • website field

This forum was archived on 2017-11-26.