I just ran into an "Undefined index: link_to_player" error when trying to create a view as described here:

http://drupal.org/node/1563586

The error is raised when I click on any of the Fields, Filter criteria, or Sort criteria values. The text in the debug window isn't selectable so I've attached an image.

Comments

sah62’s picture

No one else has run into this? The error can be fixed by adding an "isset" check before referencing $options['link_to_player']. That is, change this:

    $form['options']['mediafront']['link_to_player'] = array(
      '#type' => 'checkbox',
      '#title' => t('Link to Player'),
      '#description' => t('Check if you would like for this field to dynamically link to the MediaFront player attached to this view.'),
      '#default_value' => $options['link_to_player']
    );

to this:

  if (isset($options['link_to_player'])) {
    $form['options']['mediafront']['link_to_player'] = array(
      '#type' => 'checkbox',
      '#title' => t('Link to Player'),
      '#description' => t('Check if you would like for this field to dynamically link to the MediaFront player attached to this view.'),
      '#default_value' => $options['link_to_player']
    );
  }
  else {
    $form['options']['mediafront']['link_to_player'] = array(
      '#type' => 'checkbox',
      '#title' => t('Link to Player'),
      '#description' => t('Check if you would like for this field to dynamically link to the MediaFront player attached to this view.'),
     );
  }
ultimike’s picture

Issue tags: +Novice

Can this be reproduced with a fresh copy of Drupal core and the latest version of MediaFront?

-mike

sah62’s picture

I ran into it with the latest dev release version of MediaFront that was available on the date of my original post, but my Drupal installation is not fresh. It should be possible to reproduce with a fresh installation of MediaFront for which the view hasn't been successfully saved in the past.

drewkeller’s picture

Just ran into this myself while trying to get various players to work (MediaFront can't seem to find the minplayer, etc.). The fix in #1 worked for me to at least continue working on a view that included a media field.

drewkeller’s picture

Maybe if I make a patch, it will help. At least maybe be easier to apply next time I upgrade.

travist’s picture

Status: Active » Fixed

Thanks for your contribution. When you make patches, that gets my attention. ;)

Automatically closed -- issue fixed for 2 weeks with no activity.