Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Notice: Undefined variable: element in media_field_formatter_view() (line 162 of /home/hoslot5/public_html/sites/all/modules/media/includes/media.fields.inc).
Comment | File | Size | Author |
---|---|---|---|
#8 | undefined_variable_plus_various_bugs-1247620-8.patch | 4.53 KB | idflood |
#6 | 1247620-6_undefined_variable_plus_various_bugs.patch | 4.49 KB | wojtha |
#5 | 1247620-5_undefined_variable.patch | 535 bytes | wojtha |
Comments
Comment #1
dwkitchen CreditAttribution: dwkitchen commentedI have had this message too.
Running:
Drupal 7.8 with latest File Entity dev
Comment #2
jonathanmd CreditAttribution: jonathanmd commentedI'm also getting this warning on 7.x-2.x-dev
Comment #3
aatkinson CreditAttribution: aatkinson commentedI am also getting this error on any node that has a file type field (without the media widget enabled).
This is with Media 7.x-1.0-rc1 (which uses File Entity 7.x-1.0-rc1).
Comment #4
scoff CreditAttribution: scoff commentedLatest media 7.2.x-dev with latest file entity dev — same error.
UPD: The error's gone after node edit/save.
Comment #5
wojtha CreditAttribution: wojtha commentedComment #6
wojtha CreditAttribution: wojtha commentedI've checked the rest of the code and found several other unitialized variables and one bug.
The bug is contained in this hunk:
Comment #7
wojtha CreditAttribution: wojtha commentedComment #8
idflood CreditAttribution: idflood commentedI've carefully reviewed the patch and it globally all make sense. But I've found 2 possible issues, so here is an alternative version.
Comment #9
Dave ReidNote the changes to media_menu(), media_library(), media_filter_info(), and media_media_plugin() are actually *not* required as they do not cause PHP notices, so I committed everything else.
http://drupalcode.org/project/media.git/commit/3bf09c1 (7.x-2.x)
http://drupalcode.org/project/media.git/commit/3b27061 (7.x-1.x)
Thanks wojtha and idflood!
Comment #11
jenni4 CreditAttribution: jenni4 commentedAfter 2 days of messing with this, I still cannot for the life of me apply the last patch that was posted for 7.x-1.0-rc2. I keep getting "hunk" errors. Should I just try downloading a dev module and patching that? I thought the patch included a fix for the 1.0-rc2 ver. I'm new to Drupal and this is just one gigantic headache. This error is happening when a user posts to my forum. The post goes through but the error shows up.
TIA..now I'll go take that aspirin
Comment #12
Dave ReidBecause I didn't commit the patch as is since it required a couple of changes. All you need to do is update to 7.x-1.x-dev.
Comment #13
jenni4 CreditAttribution: jenni4 commentedOk, thanks. Will give that a try.