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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Custom field already exists error for a different custom group
Pages: [1]

Author Topic: Custom field already exists error for a different custom group  (Read 1850 times)

pbarmak

  • I post occasionally
  • **
  • Posts: 111
  • Karma: 3
  • CiviCRM version: 3.3.5
  • CMS version: Pressflow 6.19
  • MySQL version: 5.1
  • PHP version: 5.2.10
Custom field already exists error for a different custom group
February 18, 2011, 08:50:33 am
We used to be able to create two custom fields with the same label as long as they were in different custom groups.  But, as of 3.3.5 (well, maybe before, but I never tried), I'm getting the following error when I try this:
Please correct the following errors in the form fields below:
    * Custom field 'Team Number' already exists in Database.

In the database, the unique index on civicrm_custom_field is on both the label and the custom_group_id fields, so I can update the label via a db query and it shows up in the interface without error.  But I cannot then make a change using the UI, I get the same error when I try and save.

What changed here?  I'm guessing all of our currently duplicated custom fields are going to give this error whenever we try and update the help text or something ...

I'm thinking this is a bug, so I'll start a Jira too.

Tom-Tigerfish

  • I’m new here
  • *
  • Posts: 14
  • Karma: 0
  • CiviCRM version: 3.4.1
  • CMS version: Drupal 6
  • MySQL version: 5.1.36
  • PHP version: 5.2.11
Re: Custom field already exists error for a different custom group
June 03, 2011, 03:32:06 am
I am having the exact same problem in CiviCRM 3.4.1

I have had a look around but there does not seem to be a patch as yet

Any help on this would be greatly appreciated

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Custom field already exists error for a different custom group
June 03, 2011, 03:47:19 am
Hi,

It seems that the issue is that the name should be unique (not the label), but as the name is automatically generated from the label (and that you can't modify it from the UI), you can't solve it with the web interface.


For a lot of reasons, having the custom field unique among the group is almost mandatory, so that's a good thing to keep it that way, but the user interface is needing some improvment.

Can you try changing the name in the database directly for the field in error ?

After you do that, can you confirm you can then change the help text and label from the UI ?

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Custom field already exists error for a different custom group
August 27, 2012, 09:14:46 am
Hey there,

I just wanted to dredge this up again.

It seems wrong to me that you cannot have use the same label for a field in different field sets.  The rule IMO should not be that field labels should be unique.  It should be that field set + field label should be unique.

That way you can reuse common words like Score, Summary, Details, etc.  Without the ability to do this, we end up with lots of redundant extra long unfriendly field names like Opportunity details: Summary of opportunity. etc.

What is the reason we made this change? How easy would it be to reverse it?

Michael
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Custom field already exists error for a different custom group
August 28, 2012, 10:23:55 pm
Have you tried creating the field with a unique label (to set the name) then change it to something non unique?


X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Custom field already exists error for a different custom group
August 30, 2012, 05:40:43 am
Yes - I thought of that.  It doesn't work.

Even if it did, it is quite an embarrassing work around to suggest people do...
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

Yashodha Chaku

  • Forum Godess / God
  • Ask me questions
  • *****
  • Posts: 755
  • Karma: 57
    • CiviCRM
Re: Custom field already exists error for a different custom group
March 25, 2013, 07:49:59 am
This has been fixed for 4.3

http://issues.civicrm.org/jira/browse/CRM-7564

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

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Custom field already exists error for a different custom group
March 25, 2013, 09:35:45 am
Thanks Yashodha, great that this is fixed! I agree with Michael that it simply does not do for the user.
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Custom field already exists error for a different custom group

This forum was archived on 2017-11-26.