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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • label or name for unique index for civicrm_custom_field?
Pages: [1]

Author Topic: label or name for unique index for civicrm_custom_field?  (Read 834 times)

JoeMurray

  • Administrator
  • Ask me questions
  • *****
  • Posts: 578
  • Karma: 24
    • JMA Consulting
  • CiviCRM version: 4.4 and 4.5 (as of Nov 2014)
  • CMS version: Drupal, WordPress, Joomla
  • MySQL version: MySQL 5.5, 5.6, MariaDB 10.0 (as of Nov 2014)
label or name for unique index for civicrm_custom_field?
July 14, 2011, 05:34:24 pm
It seems to me that the unique key for custom fields should be based on the name rather than the label, since the name is what is used internally as a programmatic reference. If not, we should drop name. I haven't checked other similar tables, but this seems incorrect to me. Should I post a patch?

  <index>
    <name>UI_label_custom_group_id</name>
    <fieldName>label</fieldName>
    <fieldName>custom_group_id</fieldName>
    <unique>true</unique>
    <add>1.1</add>
  </index>
Co-author of Using CiviCRM https://www.packtpub.com/using-civicrm/book

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: label or name for unique index for civicrm_custom_field?
July 14, 2011, 10:20:19 pm
I think you are right and should submit a patch.

However, as the name is generated by the label and not exposed in the UI, won't probably make a big difference.

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

JoeMurray

  • Administrator
  • Ask me questions
  • *****
  • Posts: 578
  • Karma: 24
    • JMA Consulting
  • CiviCRM version: 4.4 and 4.5 (as of Nov 2014)
  • CMS version: Drupal, WordPress, Joomla
  • MySQL version: MySQL 5.5, 5.6, MariaDB 10.0 (as of Nov 2014)
Re: label or name for unique index for civicrm_custom_field?
July 15, 2011, 08:04:05 am
I'll submit a patch. The name is 64 chars, and is set once, and the label is 255 and can be changed through the interface without that affecting the name.
Co-author of Using CiviCRM https://www.packtpub.com/using-civicrm/book

JoeMurray

  • Administrator
  • Ask me questions
  • *****
  • Posts: 578
  • Karma: 24
    • JMA Consulting
  • CiviCRM version: 4.4 and 4.5 (as of Nov 2014)
  • CMS version: Drupal, WordPress, Joomla
  • MySQL version: MySQL 5.5, 5.6, MariaDB 10.0 (as of Nov 2014)
Re: label or name for unique index for civicrm_custom_field?
July 15, 2011, 08:53:34 am
CRM-8507
Co-author of Using CiviCRM https://www.packtpub.com/using-civicrm/book

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • label or name for unique index for civicrm_custom_field?

This forum was archived on 2017-11-26.