I get a lot of the following errors in the frontpage (apparently it's the teaser view that triggers the errors), after upgrading to Drupal 7.2. I tried disabling all contributed modules and still got the error. Functionality does not seem to be affected though.

<pre>
Notice: Undefined offset: 63 in media_field_prepare_view() (line 114 of /home/xxxxxxxx/drupal7/sites/all/modules/media/includes/media.fields.inc).

Warning: Invalid argument supplied for foreach() in media_field_prepare_view() (line 114 of /home/xxxxxxxx/drupal7/sites/all/modules/media/includes/media.fields.inc).
</pre>
CommentFileSizeAuthor
#14 media.1170090.patch1.21 KBrfay
#8 media.1170090.patch1.21 KBdrclaw

Comments

c-c-m’s picture

I have exactly the same problem after upgrading to d7.2

The warning appears when displaying a view which has any field with media module on the teaser, no matter you have set that field to be displayed or not. When the complete node is shown the error doesn't show off.

Tested with D7.1 and the warning doesn't show off.

yareckon’s picture

c-c-m’s picture

I can confirm that I am using drupal in Spanish

c-c-m’s picture

Yareckon: I've been reading issue #1089174 and it seems that it has been commited to D7.1, and thus to 7.2 which is the one that is causing the problem. It seems to me (although I have to admit I am no expert at all) that that issue is not related to this problem.

Carlos: did you make any progress?

Carlos Miranda Levy’s picture

It was fixed for b4 and dev, but then came beta5 and the new dev and it all stopped working again.
I am running a multi-language site (or hoping to...) and after latest upgrades of media a and media_youtube, all these issues are present in my error log (and the videos don't show), so I'm taking some time to make sure all patches are different and to see if I need them all:

Trying to get property of non-object in media_youtube_file_styles_filter()
http://drupal.org/node/1174950

Notice: Trying to get property of non-object in file_styles_styles_filter()
http://drupal.org/node/1175008

Fatal error after Drupal 7.2 update
http://drupal.org/node/1172478

Modules have no chance to intercept prior to hook_field_prepare_view()
http://drupal.org/node/879034

Field invoke multiple does not handle field language correctly
http://drupal.org/node/1169426

Prepare view hooks do not receive the language parameter
http://drupal.org/node/1089174
http://drupal.org/node/1172062

jagermonster’s picture

subscribing, i have a site running drupal 7.2 with media 7.x-1.0-beta4 and media_youtube 7.x-1.0-alpha5 module. when nodes with attached media are set to display as teaser on the frontpage and are promoted to front page i get the above errors.

drclaw’s picture

subscribing.

I also am getting the same errors with the same versions as @jagermonster in comment #6

drclaw’s picture

Status: Active » Needs review
StatusFileSize
new1.21 KB

If anyone wants a quick fix they can use until this is fixed you can try this patch. I created the patch against the beta4 release so anyone using that version should be able to apply it with git apply -v [patchname.patch]

It's just a quick check to make sure the foreach loop is receiving a proper array. The problem could be deeper than just that, but it will suppress the errors for now while it the actual problem can be determined.

Status: Needs review » Needs work

The last submitted patch, media.1170090.patch, failed testing.

yareckon’s picture

#1169426-7: Field invoke multiple does not handle field language correctly -- sorry folks I meant that I think this is the issue to watch for these file prepare view warnings. The previous one I posted was the api problem that caused the change.

pcambra’s picture

Applied patch suggested by yareckon, last version is here http://drupal.org/node/1169426#comment-4552160 and the notice goes away

rfay’s picture

Version: 7.x-1.0-beta4 » 7.x-1.x-dev
Status: Needs work » Needs review

Setting to dev version and to "needs review"

rfay’s picture

#8: media.1170090.patch queued for re-testing.

rfay’s picture

StatusFileSize
new1.21 KB

# 8 again, but set to test the dev version.

Status: Needs review » Needs work

The last submitted patch, media.1170090.patch, failed testing.

c-c-m’s picture

Version: 7.x-1.x-dev » 7.x-1.0-beta4

I can confirm what pcambra says: applyed patch http://drupal.org/node/1169426#comment-4552160 and the warning doesn't show up again.

arthurf’s picture

Status: Needs work » Closed (fixed)

http://drupal.org/node/1169426 went into drupal core. Closing as it should be fixed by core now.