0

I have added a textarea and i want to store more that 1024 characters in it. Long text is the field type that i have chosen but an error comes up saying :
Keywords cannot be longer than 1024 characters but is currently "xx" characters long.

I tried using hook_form_alter to increase the maxlength but it does not work. Also tried the hook_form_field_ui_field_edit_form_alter to change the length from 255 to 555 but no success.
Is there any other workaround for this ?

1 Answer 1

0

Use Field maxlength alter module

  • Creating an update hook that alters the field tables
  • Installing this module and simply edit the max_length in the admin interface
  • Installing this module and run the Drush command to modify the max_length
2
  • I tried using this module but option to increase Maximum length does not appear for textarea's. It comes up for textfields only. Commented Jan 27, 2016 at 10:34
  • That's because long text fields don't have a max length @KapilRopalekar, having such a setting wouldn't make sense. They use a big text, per text_field_schema, which in MySQL translates to a LONGTEXT, which has ~4GB of storage - considerably more than 1024 characters worth. Drupal core doesn't impose this limit, so you need to start disabling contrib modules one by one until you find which one is doing it. After that you can work out how to get around it
    – Clive
    Commented Jan 27, 2016 at 10:45

Your Answer

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

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