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...
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | field_select.inc | 2.58 KB | Patrick Nelson |
Comments
Comment #1
Patrick Nelson commentedServal,
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.
Comment #2
Bèr Kessels commentedPatch needs to be updated.
Comment #3
Bèr Kessels commentedSeems to be fixed in HEAD. please re-open if you can still reproduce.
Comment #4
(not verified) commented