Closed (fixed)
Project:
File Entity (fieldable files)
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Feb 2012 at 06:45 UTC
Updated:
12 Nov 2012 at 16:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
rooby commentedI am doing this with audio and video file types if it matters.
Comment #2
amfriedman commented+1
Comment #3
dave reidI'm unable to reproduce this but I see it occasionally. The best thing is to add a dpm(debug_backtrace()) to file_icon_path() to help debug where the issue is coming from and what function calls are in the tree causing the error.
Comment #4
damienmckennaIn my situation it stems from using a video field using Media v2 and generated content.
Comment #5
drzraf commentedvery probably related #1139980: Undefined index: file_icon_path
Comment #6
dave reidStill have been unable to reproduce this error. I think we might need more detailed, exact steps to reproduce otherwise I'll have to close this issue.
Comment #7
oystercrackher commentedI am getting the same error: Notice: Trying to get property of non-object in file_icon_path() (line 809 of C:\Melissa\Drupal\Installation\Versions\Drupal Core\drupal-7.x\modules\file\file.module).
My steps were as follows:
I have created MiniPanel with Photos in one panel on the left and Videos in another pane on the right. I have selected "media" as the formatter and have selected "preview" as the view mode". When viewing the page, I get the error listed above; this error only exists for the preview view mode. I hope this helps.
This happens if I use my own content or devel generated content.
Please let me know if you need anything else.
Thanks
Comment #8
oystercrackher commentedOK! I was able to resolve this issue for photos by doing the following:
Under structure/file types on the manage file display tab, select preview mode, ensure that image is selected for enabled displays, then for view modes for the image, select thumbnail (apparently square thumbnail was originally set); then save. Issue resolved for photos in preview mode.
This does not solve the issue for videos in the preview mode however; can someone please advise what display is being used for videos and how it may be fixed. Would like to ensure that can see small still image which then links to content when selected.
Thanks
Comment #9
esmerel commentedI get this error on lines 809, 852, and 824 (probably a dozen messages total)
I only see this when I attempt to use the 'preview' file view mode for the media field in a view. The preview comes up, but there's those errors. If I use any other file view mode, they don't show any images, but they also don't spit errors.
I'm currently using 7.x-2.0-unstable5+4-dev. There's nothing in the error log. Sadly, oystercrackher's suggestion did not work for me.
Comment #10
esmerel commentedOK, I have done the backtrace and merlinofchaos says that media_formatter_large_icon is being called without a file.
I've attached the tiny bit that merlin thought was important, but I can give access later.
Comment #11
dave reidI think I'm able to replicate this having a local video file entity being run through file_view($file, 'media_preview') using the defaults of Media module. I'm looking into this now to debug further.
Comment #12
robertinop commentedI am getting the same errors as #9, with Media 7.x-2.0-unstable6+3-dev (2012-Jul-26) and Media: YouTube 7.x-2.0-alpha2+2-dev (2012-Jul-24). This is after updating from the recommended version of Media:YouTube, 7.x-2.0-alpha2 (2012-Apr-24). Also as with #9, this happens when displaying a view block of videos using Preview view mode, and not with other view modes. I'm using Views 7.x-3.3.
Maybe this will help narrow down the problem?
Comment #13
drzraf commentedsee also the stacktrace posted in #1139980: Undefined index: file_icon_path
Comment #14
dave reidI have already posted I've been able to track what's going wrong. I'll be debugging and attempting to fix this weekend.
Comment #15
Kazanir commentedThis appears to work fine in the Views Preview when setting up the view, but then throws all of these errors when looking at the live page. It seems to clearly be a problem with the Large File Icon or Generic File rendering option:
- The reason many people are seeing it is because "Rendered file" seems to default to Generic File if no rendering types are picked for the particular display type. (In my case, I had forgotten to set up the Preview display type for several kinds of file.)
- Once I set up the Preview display type and put "URL to file" underneath the the LFI/GF options, that put a floor under the display possibilities and prevented the error from showing up. I assume the error is still occurring which is why the Generic File rendering is failing to show up and I get the link instead.
- Strangely, the GF option DOES seem to work as part of the standard Media Browser format for Views. I only observe this error when switching to a Grid format and displaying the File or Rendered Entity, or when displaying Fields with Rendered File as one of the fields.
Comment #16
esmerel commentedI'd concur with previous poster - I changed the formatter to 'small' instead of preview and all the errors went away.
Comment #17
damienmckennaCould it be that 'preview' did had an incomplete display configuration, e.g. an image style wasn't defined, etc?
Comment #18
esmerel commentedI created a 'preview' image style. It seems that the errors aren't happening now. I'm not sure that's the 'correct' behavior, since there's file view modes available that aren't listed as image styles. Maybe I'm mixing the terms up?
Comment #19
esmerel commentedbah, spoke too soon. Still happening.
Comment #20
eusonic commentedDave,
Any update on this bug?
Thanks
-Cameron
Comment #21
esmerel commentedI wouldn't expect any updates from Dave for a few weeks at least. https://twitter.com/davereid/status/257995930236760064
Comment #22
damienmckennaMaybe someone could request this to be worked on during next week's code sprint? #1817164: Brainstorming & priorities planning for the Drupalcamp Atlanta 2012 Code Sprint
Comment #23
agentrickardTaking a sprint look.
Comment #24
agentrickardCannot replicate. An export of settings for the View and the File Type would be immensely helpful.
Comment #25
agentrickardComment #26
esmerel commentedHere you go.
Comment #27
esmerel commentedI can also provide access to a site where this is replicatable :) Dave had already done so, but things got in the way. :D
Comment #28
agentrickardGot it, thanks.
Comment #29
agentrickardActually, the error I get is:
But i haven't loaded any video files in yet.
Comment #30
agentrickardOK, getting both errors now.
Comment #31
esmerel commentedThe views error is a known issue #1816960: Trying to get property of non-object in views_handler_field_comment_link->render_link() (line 52 of views_handler_field_comment - I have a hack fix in on my site, but merlinofchaos wants to fix it properly when he gets a chance. I didn't think to mention it, sorry!
Comment #32
agentrickardAs far as I can tell template_preprocess_file_entity() never attaches the $file to $variables['content'] during the render process.
This patch addresses that issue.
Comment #33
agentrickardYeah, that Views bug is unrelated to this issue. I just removed the comment fields.
Patch seems to work. Note, however, that it actually changes the render style of the large file icon.
Comment #34
agentrickardComment #35
esmerel commentedPatched this manually against 7.x-2.0-unstable6 and the error is gone, hooray!
Comment #36
ParisLiakos commentedapplied the patch and tested, this doesnt changes large filetype icon for me:/
Thanks agentrickard!
patch commited
http://drupalcode.org/project/file_entity.git/commit/30d1f66
Comment #37
agentrickardHere's the change for me, using @esmerel's view.
Comment #38
ParisLiakos commentedseems that the after is the correct one:) the fitst one is for document:/