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 Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Shared custom field? Issue apparent with recent upgrade to 4.1
Pages: [1]

Author Topic: Shared custom field? Issue apparent with recent upgrade to 4.1  (Read 536 times)

artfulrobot.com

  • I post occasionally
  • **
  • Posts: 81
  • Karma: 4
Shared custom field? Issue apparent with recent upgrade to 4.1
May 18, 2012, 01:35:52 am
Hi

On a contact's record I have a custom field set about toys (not real use case) they own. One contact may have 0 or more toys.

I have a couple of different activities each with custom fieldset, and each of these needs to refer to a particular toy that the person owns.

So far the toy names in all three places are text fields, and they're all separate fields. I am planning to add some jQuery into the activity custom fields template so that the user is instead offered a drop-down select of the valid toy selections, instead of a text box which can easily end up with a mismatch.

This was ok, (although not great to have three custom_NN fields for the same data), until the upgrade. Now I find that I cannot add a custom field with the same name (label) as another custom field. So when I went to introduce a third activity that also needs to reference the toy name, as well as store custom data itself, a new custom fieldset did not allow a field called Toy Name.

Am I correct to think that the only way to resolve this would be to separate out the Toy reference fields into a separate fieldset that is shared by all Activities? ???

I have resisited this because although more normalised from a data POV, it adds overhead and reduces the user joy because I'll end up with a big bulky "fieldset" with one field for Toy, and then another, separate field set for another single field, "Game played with toy". Of course I could do some pretty big jQuery rearranging of the DOM, but that is also a bit inelegant. :-\ For example in Drupal the field API allows fields to be shared between content types.

Would be great to know that I'm on the right (only) track, if that's true, or to hear of anything I've missed/got wrong.

Thanks, all.

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: Shared custom field? Issue apparent with recent upgrade to 4.1
May 18, 2012, 07:41:02 am

I think the custom field label or profile field should be unique only within the custom group / profile group. I think sharing labels is quite a common need and would be good to get that fixed.

Can you take a look and submit a patch that fixes the form rule?

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Shared custom field? Issue apparent with recent upgrade to 4.1

This forum was archived on 2017-11-26.