Closed (fixed)
Project:
MediaFront
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Jan 2013 at 06:39 UTC
Updated:
27 Feb 2013 at 00:40 UTC
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?
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 }
What should be done to truly fix this issue? Did I miss something?
Comments
Comment #1
travist commentedDoes this work for the OSM Player?
Comment #2
greenskunkI'll test the OSM player in a bit.
Comment #3
pagaille commentedI 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).
Comment #4
travist commentedShould be fixed in latest DEV version. Thanks.
Comment #5.0
(not verified) commentedmissed some words 8(