Problem

The list of values is empty when you want to edit a select field

How to reproduce

  • Create a new node type
  • Add a select field. Don't forget to add some list values
  • Save the new node type
  • Edit the select field again. The textarea with the list values will be empty

Proposed resolution

I feel sorry I can't provide a patch file. My corporate firewall forbids me to connect to the cvs port. But I think the folowing replacement will to the trick:

Replace this code in field_select.inc:

function flexinode_field_select_config($field, $edit) {
  return array('options' => array(
    '#type' => 'textarea',
    '#default_value' => is_array($edit['options']) ? implode('|', $edit['options']) : '',
    '#description' => t('Please enter a pipe delimited list of options with no cairrage returns. For example: "Red|Blue|Green" or "Small|Medium|Large"'),
    ));
}

with the following code:

function flexinode_field_select_config($field) {
  return array('options' => array(
    '#type' => 'textarea',
    '#default_value' => is_array($field->options) ? implode('|', $field->options) : '',
    '#description' => t('Please enter a pipe delimited list of options with no cairrage returns. For example: "Red|Blue|Green" or "Small|Medium|Large"'),
    ));
}

If someone who feels this code is correct, could create a patch for this issue...

CommentFileSizeAuthor
#1 field_select.inc2.58 KBPatrick Nelson

Comments

Patrick Nelson’s picture

StatusFileSize
new2.58 KB

Serval,

Many thanks for this - that saved me an hour or two!

I can't create a patch either, but for anyone who wants it, I've attached a copy of file_select.inc with the changes made.

Bèr Kessels’s picture

Version: » master
Component: Code » Field type: select
Priority: Critical » Normal
Status: Active » Needs work

Patch needs to be updated.

Bèr Kessels’s picture

Status: Needs work » Fixed

Seems to be fixed in HEAD. please re-open if you can still reproduce.

Anonymous’s picture

Status: Fixed » Closed (fixed)