This module is awesome, thanks! I've created a simple formatter that renders the CSV content of a text field as a select list. So far, so good, But I can't get it to render as a multiple select list in the preview or in my view. Here' s my code:

// Formatter settings.
$settings = $variables['#display']['settings'];

$element = array();
foreach ($variables['#items'] as $delta => $item) {
  $mods = drupal_map_assoc(explode(',', $item['value']));
  $element[$delta] = array(
    '#type' => 'select',
    '#options' => $mods,
    '#multiple' => TRUE,
  );
}
return $element;

Tried cache clearing, no luck. Tried '#multiple' = 1, nope. Also noticed that '#disabled' => TRUE has no effect. Is there a limited set of FormAPI attributes that will work with this?

Comments

Deciphered’s picture

Version: 7.x-2.2 » 7.x-2.x-dev

I have confirmed this issue and will look into it once I have cleared out all minor issues from the issue queue.

Deciphered’s picture

Status: Active » Closed (won't fix)

I have confirmed by running the following code via Devel's execute PHP interface the #multiple attribute is also ignored, and as such this is not an issue with Custom Formatters:

$element = array(
  '#type' => 'select',
  '#options' => array('test', 'test2'),
  '#multiple' => TRUE,
  '#size' => 2,
);
dpm(drupal_render($element));

Note: This only renders out the markup, not the form, but taking that markup and inserting it back into the page via Chrome developer tools or similar proves the point.