0

This is how I've defined the content_body in my FieldWidget:

$widget['content_body'] = array(
  '#title' => $this->t('Body text'),
  '#type' => 'textarea',
  '#default_value' => isset($items[$delta]) ? $items[$delta]->content_body : '',
);

which allows me to enter more than 255 characters when editing/creating the content. However, I get an error when more than 255 characters are entered and the content is created/updated.

This is the schema in my FieldType class:

$schema['columns']['content_body'] = array(
  'type' => 'text',
  'size' => 'tiny',
  'not null' => FALSE,
);

1 Answer 1

2

Use field type as Text (formatted, long) or Text (formatted, long, with summary)

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.