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).

CommentFileSizeAuthor
#1 scald-title-length-2527534-1.patch518 bytesnicoloye
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nicoloye’s picture

Status: Active » Needs review
FileSize
518 bytes

Here is a fixing patch.

  • jcisio committed 1a79dca on 7.x-1.x authored by nicoloye
    Issue #2527534 by nicoloye: Atom title length consistency between base...
jcisio’s picture

Status: Needs review » Fixed

The patch looks good. In system_element_info() the textfield element has a default maxlength of 128. Committed and pushed. Thanks!

Status: Fixed » Closed (fixed)

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