Why is there such a limit? With a lot of content types and fields, I would like to be very specific and detailed in my field id's so when I go to permission, I know exactly what I'm dealing with. 32 is not enough for me.

And the problem with that input text field, why is it not limited to 32 characters so we cannot enter anything more? It's no good to click "Save" and get a validation error back. Then I start counting characters cutting out characters. And a lot of time, I have started on a naming pattern and created a bunch of other fields with that pattern. Then I got over this limit and I have to change my naming pattern to shorten things. Now I have to go back and delete all those fields and do over :( I know this is ridiculous but I like to keep all names very consistent and obvious so I don't make a mess that no one else can understand down the road.

Anyway, it would be nice if we can have longer field id.

CommentFileSizeAuthor
#4 field-id-maxlength.patch690 bytesmattyoung

Comments

markus_petrux’s picture

Category: support » feature
Status: Active » Closed (works as designed)

This is by design. Note that field names are used to derive database column names, and here the limit comes from the SQL engines. MySQL supports more, but this is not the case in PostgreSQL, for example.

You need to use abbreviations or names that are short enough to fit into the current limit.

mattyoung’s picture

Status: Closed (works as designed) » Active

>the limit comes from the SQL engines

I see. Thanks.

So please make that input field limited to the number characters allowed? Save us a trip to the server only to get a validation error back. This also help in come up with the right length without counting character. Right now we can put in longer name and we don't where it should end other than counting character.

markus_petrux’s picture

Status: Active » Closed (works as designed)

If you don't have it already, install the Advanced Help module.

When AH is enabled, a small icon with a question mark is rendered next to the "New Field" label. If you click this icon, a popup window opens and you'll see here this limitation documented: "The length of the field name cannot exceed 32 characters (including the 'field_' prefix that gets added automatically - that is, 26 free characters)".

If you try to use a field name longer than this limit, the field is not created and you get an error similar to "Add new field: the field name field_xxxxxxxxxxxxxxxxxxxxxxxxxxx is too long. The name is limited to 32 characters, including the 'field_' prefix."

mattyoung’s picture

Status: Closed (works as designed) » Needs review
StatusFileSize
new690 bytes

set #maxlength so it's impossible to enter more than is allowed.

markus_petrux’s picture

Title: 32 characters limit on field id » 32 characters limit on field and group identifiers in "Manage fields" screen
Status: Needs review » Fixed

Committed a slight variation of your patch to CVS. Group identifiers may also benefit from this. ;-)

http://drupal.org/cvs?commit=283132 (CCK2)
http://drupal.org/cvs?commit=283134 (CCK3)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.