Skip to Content Skip to Menu

[#6048] What is the maximum lenght of a custom field's internal name?

8 years 5 months ago - 8 years 5 months ago #282813 by STUCKSHUTTER
I ran into a problem with a 34 character long internal field name (cb_custom_email_after_banner_html) on a editor text area field. The field created and displayed fine, however, it would not update the database.

Surmising the most likely cause of the problem was mine since CB is rock solid, I could think of nothing else than the internal name being too long and causing some issues that didn't produce an error but didn't work either.

I shortened the internal name to 25 and the field updated with no problem.

What is the longest internal field name we can use?

Obviously, validating the length of the name field or setting a max length for input might be a good idea; not critical for sure but perhaps helping avoid a problem.

Thanks!
Last edit: 8 years 5 months ago by krileon. Reason: Added [#6048] tag to subject

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48536
  • Thanks: 8290
  • Karma: 1445
8 years 5 months ago #282866 by krileon
The column is varchar(50) meaning it supports a maximum of 50 characters for field name. Have added a feature ticket to consider increasing this to 255 to allow for much longer field names.

forge.joomlapolis.com/issues/6048


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • beat
  • beat
  • ONLINE
  • Posts: 2169
  • Thanks: 463
  • Karma: 352
8 years 5 months ago #282871 by beat
There is also a limit in MySQL for column names. So we should actually not allow to input more characters than MySQL's maximum, imho.

Beat - Community Builder Team Member

Before posting on forums: Read FAQ thoroughly -- Help us spend more time coding by helping others in this forum, many thanks :)
CB links: Our membership - CBSubs - Templates - Hosting - Forge - Send me a Private Message (PM) only for private/confidential info

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48536
  • Thanks: 8290
  • Karma: 1445
8 years 5 months ago #282876 by krileon
Appears the limit is 64 for column names. I don't recommend using extra long field names. For now I think we'll keep the limit at 50 as it's not good to hit the limit.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

8 years 5 months ago #282881 by STUCKSHUTTER
That certainly makes sense and I agree. Limiting the field input to the same 50 characters would be helpful so people don't do what I did and go over the limit. I'm guessing that you've done that already.
No matter, thanks for taking a good look at this and explaining the rationale and limitations. Much appreciated.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48536
  • Thanks: 8290
  • Karma: 1445
8 years 5 months ago #282888 by krileon
The validation should kick in. It shouldn't create the field if the name is passed the limit. Have added a bug ticket to look into this further.

forge.joomlapolis.com/issues/6051


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum