Problem/Motivation

Created a Views Slideshow that uses a MediaFront preset for using the MediaFront minplayer and had the following error upon loading the view.

Notice: Undefined index: mediafront in mediafront_field_formatter_view() (line 107 of /path/to/sites/all/modules/mediafront/includes/mediafront.field.inc).

The slideshow still works but what is the mediafront array item supposed to contain?

Proposed resolution

For a quick fix to HIDE the Notices, I added a check for the mediafront array item IS SET in mediafront.field.inc

// If a views field is defined, use the options from it instead.
    102         if (!empty($view)) {
    103           $include = FALSE;
    104           foreach ($view->field as $view_field) {
    105             if ($view_field->field == $name) {
    106               $include = TRUE;
    107               // added isset for quick fix
    108               if (isset($view_field->options['mediafront'])) {
    109                 $options = $view_field->options['mediafront'];
    110               }
    111               break;
    112             }
    113           }
    114         }

Remaining tasks

What should be done to truly fix this issue? Did I miss something?

Comments

travist’s picture

Does this work for the OSM Player?

greenskunk’s picture

I'll test the OSM player in a bit.

pagaille’s picture

I can confirm this fix works for the OSM player as well. My view was fine until I exported it to code; once it was in code this notice appeared. This was just a "regular" view with three fields displayed: the node body, the embedded media field (with media front content), and a regular file upload field (generic files).

travist’s picture

Status: Active » Fixed

Should be fixed in latest DEV version. Thanks.

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

missed some words 8(