2

We are facing a problem with CiviCRM's default field length for organization names.

Background: In our setup we handle big departments or organizational units as distinct contacts. Since the sole department's name isn't sufficient for naming the contact and due to some limitations of CiviCRM (as discussed here) we've decided to compose the the name from the base organization name and the department's name.

Example:

Contact A: Base Organization named "University of Bielefeld",
Contact B: Department of A named "University of Bielefeld || Faculty of Physics"
Contact C: Department of A named "University of Bielefeld || FooBar Institute"

This leads in come cases to names exceeding the maxlength of contact name fields which is 128.

Setting those in the database is easy but adjusting CRM/Contact/DAO/Contact.php's column definitions makes core updates harder :/

How would you handle this? @Civi developers: Any chance to make field size configurable or increase size to 255 in general?

2
  • the link in the question shows Page Not Found error. Can you please update the link ? Feb 10, 2016 at 10:28
  • Oye! Sorry. Updated my question!
    – nielo
    Feb 10, 2016 at 10:44

1 Answer 1

1

Interesting one. I would probably add a custom field at Organization level with the full name and use an abbreviated version in the display name. Possibly add an extension to show the custom name in forms with the buildForm hook and the summary hook. Also add an apiWrapper hook to add the longer name to the API.

3
  • You would do all this instead of increasing field's max length?
    – nielo
    Feb 10, 2016 at 20:20
  • Yes, I do not want to directly change a field in the database. It will hurt me in upgrades and I potentially run into all sorts of problems. So I use the recommended way to customize CiviCRM. And it is not a lot of trouble :-) Feb 11, 2016 at 7:33
  • 2
    Personally I agree with @nielo that it seems cumbersome to develop intricate workarounds for something relatively trivial like increasing a field length. There are a number of places where minor changes to the DAO may need to be made and currently the only way to do that is with an override file. I would like to see a hook where the DAO values can be modified. Aside from things like field length, the DAO does things like sets the default exportable fields -- meta data on the columns that should be more easily alterable. Mar 31, 2016 at 16:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.