Problem/Motivation

I want to add a media field to a form. I use the following snippet:

$form['image'] = array(
      '#type' => 'media',
      '#tree' => TRUE,
      '#title' => t('Image'),
      '#description' => '',
      '#input' => TRUE,
      '#media_options' => array(
          'global' => array(
              'types' => array('image'),
          ),
      ),
  );

In 2.x-alpha it works fine. I get the media widget and can attache images with the media browser.
But in 2.0-beta1 it doesn't work anymore. I get only the non JS fallback:
media fallback

I know, there are API changes but I can't find a solution.

CommentFileSizeAuthor
media_fallback.JPG9.59 KBJ-Lee
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

J-Lee created an issue. See original summary.

Chris Matthews’s picture

Version: 7.x-2.0-beta1 » 7.x-2.x-dev
Status: Active » Closed (outdated)

Closing this issue as outdated. However, if you think this issue is still important, please let us know and we will gladly re-open it for review.
sincerely,
- the Drupal Media Team