Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
Deciphered CreditAttribution: Deciphered commentedI have confirmed this issue and will look into it once I have cleared out all minor issues from the issue queue.
Comment #2
Deciphered CreditAttribution: Deciphered commentedI 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:
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.