Drupal allows you to create fields with a label that has a maximum length of 128 characters. Meanwhile, display suite fields are limited to only 32 character labels.

I believe this is because Display Suite is limiting label length to the same size as the machine name for fields. I was thinking altering the form to increase the limit allowed on the label field would be enough to fix the error.

Would altering the form and saving a longer label cause any problems elsewhere?

CommentFileSizeAuthor
#2 1822404-2.patch507 bytesswentel

Comments

swentel’s picture

Title: Error message Label cannot be longer than 32 characters but is currently 35 characters long. » Allow custom fields label cannot be longer than 32 characters.
Category: bug » feature

Hmm, don't think that would cause any problems, never though about that.

swentel’s picture

Status: Active » Closed (fixed)
StatusFileSize
new507 bytes

Changed maxlength of label in 7.x-2.x and 8.x-2.x

elvis2’s picture

@swentel, doesn't the ds.install file need to be updated too? It looks like the ds_view_modes schema is allowing a length 32 chars as well.

elvis2’s picture

Also, does the machine name length need to be addressed?

elvis2’s picture

Issue summary: View changes

fixed typo

maximpodorov’s picture

Issue summary: View changes
Status: Closed (fixed) » Active

Funny fix. It allows to enter long names but these names can't be stored in the database since DB field length is still 32.

aspilicious’s picture

This si about the field label length.
That length can be 128 chars according to the summary:

"Drupal allows you to create fields with a label that has a maximum length of 128 characters"

So why can't they be stored?

maximpodorov’s picture

  $schema['ds_fields'] = array(
    'description' => 'The table that holds custom fields managed by Display Suite.',
    'fields' => array(
      'field' => array(
        'description' => 'The machine name of the field.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'label' => array(
        'description' => 'The label of the field.',
        'type' => 'varchar',
        'length' => 32,   <---------------------- I mean this.
        'not null' => TRUE,
        'default' => '',
      ),
aspilicious’s picture

Version: 7.x-2.0 » 7.x-2.x-dev
Status: Active » Fixed

I added an update hook to increase the length to 128. Display Suite dev should be ok now.

Status: Fixed » Closed (fixed)

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