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

dopry - August 1, 2008 - 06:14
Status:active» closed

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

dboulet - October 8, 2008 - 19:02
Project:FileField» MimeDetect
Version:5.x-2.3» 5.x-1.0
Category:support request» bug report
Status:closed» patch (code needs review)

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->filepath as an argument. This could be a result of running Drupal in a Windows environment.

The attached patch passes $file->filepath through the realpath() function so that the file is properly located by finfo_file().

AttachmentSize
mimedetect-288811-realpath.patch693 bytes
 
 

Drupal is a registered trademark of Dries Buytaert.