"Multiple" CCK Field for File Download Plans won't stay selected on node Edit

2 replies [Last post]
benklocek
User offline. Last seen 1 week 3 days ago. Offline
Joined: 07/30/2010

I have a content type that uses the Moneyscripts File CCK field type and I have it set to "Unlimited" in the Global Settings portion of the CCK field editor.

It operates fine when I select from the File Plans drop down, and displays all the selected items, but when I "Edit" the node they are associated with, the select dropdowns are all empty and I need to re-select them, or they get removed from the node.

benklocek
User offline. Last seen 1 week 3 days ago. Offline
Joined: 07/30/2010
Also happens when not set to

Also happens when not set to "Unlimited" (ie. when using it as described in the support docs.)

wildkatana
User offline. Last seen 3 hours 50 min ago. Offline
Joined: 06/03/2009
I have found this bug and it

I have found this bug and it is now fixed. It will be released in the next version soon.

If you'd like to fix it yourself in the interim, you can add the following line to the ms_files_cck_widget function in ms_files_cck.module file.

Replace:

$element['value'] = array(
    '#type' => 'select',
    '#title' => 'File Download Plan',
    '#options' => $fileList,
    '#attributes' => array('class' => 'ms_files_cck'),
    '#required' => $field['required'],
  );

with:

$element['value'] = array(
    '#type' => 'select',
    '#title' => 'File Download Plan',
    '#options' => $fileList,
    '#attributes' => array('class' => 'ms_files_cck'),
    '#required' => $field['required'],
    '#default_value' => $items[$delta],
  );

Sincerely,

Leighton Whiting