function media_field_widget_value

cis7 media.fields.inc media_field_widget_value($element, $input, $form_state)
cle7 media.fields.inc media_field_widget_value($element, $input, $form_state)
elmsmedia7 media.fields.inc media_field_widget_value($element, $input, $form_state)
icor7 media.fields.inc media_field_widget_value($element, $input, $form_state)
meedjum_blog7 media.fields.inc media_field_widget_value($element, $input, $form_state)
mooc7 media.fields.inc media_field_widget_value($element, $input, $form_state)

Widget value.

@todo Is this function ever called? If not, remove it. The Field API now supports automatic serialization / unserialization, so this should no longer be needed. After verifying with a module that uses the 'data' column, remove this.

See also

media_field_widget_form()

File

sites/all/modules/ulmus/media/includes/media.fields.inc, line 199
Provide the media file selector widget and media field formatters to the Fields API.

Code

function media_field_widget_value($element, $input, $form_state) {
  $return = $input;

  if (!is_array($return)) {
    $return = array();
  }

  if (isset($return['data'])) {
    $return['data'] = serialize($return['data']);
  }

  $return += array(
    'fid' => 0,
    'title' => '',
    'data' => NULL,
  );

  return $return;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.