Icons are incorrect
nektir - July 29, 2008 - 23:27
| Project: | MimeDetect |
| Version: | 5.x-1.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | patch (code needs review) |
Description
When I add documents with filefield and click upload, it shows the correct icon (pdf, text, etc.) next to the field for the name of the document, but when I click submit to submit the content. The page shows a blank page icon. Looking at the code I get very strange class names and image class names for the icons. For example:
<div class="filefield-icon field-icon-cannot open `files-forms-Direct Deposit Form- Non-US Bank.pdf' (No such file or directory)"><img class="field-icon-cannot open `files-forms-Direct Deposit Form- Non-US Bank.pdf' (No such file or directory)" src="http://www.mysite.com/sites/all/modules/filefield/icons/protocons/16x16/mimetypes/application-octet-stream.png" /></div>I downgraded to version 5.x-2.3rc4 and found this issue does not exist. Has anyone else encountered this?

#1
1) install the transliteration module if you haven't. 2 verify mimedetect is working properly... test with head.. There was a minor changes to the icon generating, but this looks like mime detect cannot open the file.
#2
I was having the same problem as the original poster. The problem is that, when using the PHP fileinfo extension, the function
finfo_file()can't find the file when passed$file->filepathas an argument. This could be a result of running Drupal in a Windows environment.The attached patch passes
$file->filepaththrough therealpath()function so that the file is properly located byfinfo_file().