Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello,
on our project we use feeds_scald to import multiple scald atoms in a drupal instance. We had problems with some of the items that were imported with title with length between 128 and 255 caracters.
In the schema definition of an atom the title is defined like this :
'title' => array(
'description' => 'The title of this Scald Atom.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
but in the atom add/edit form the title field if defined like this :
$form['atom' . $delta]['title'] = array(
'#type' => 'textfield',
'#title' => t('Title'),
'#required' => TRUE,
'#default_value' => $atom->title,
'#parents' => array('atom' . $delta, 'title'),
'#weight' => -10,
);
No maxlength is defined meaning the length is set by the core defaults which is 128 resulting in improper validation errors (feeds_scald also needs a proper length check but I'll open a proper issue on this module too).
Comment | File | Size | Author |
---|---|---|---|
#1 | scald-title-length-2527534-1.patch | 518 bytes | nicoloye |
Comments
Comment #1
nicoloye CreditAttribution: nicoloye at Actency commentedHere is a fixing patch.
Comment #3
jcisio CreditAttribution: jcisio at Axess Open Web Services for ARTE G.E.I.E. commentedThe patch looks good. In system_element_info() the textfield element has a default maxlength of 128. Committed and pushed. Thanks!