Hello, we're having some problems/glitches uploading files via the FileField module.
- The upload works without error, but when you view the node it doesn't appear - just a blank bullet (though the File Description field works). For example:
http://www.blindmicemedia.com/dev/dublin/staging/business_advantages-sci...
- Also, the client mentioned that in "Edit mode" there is an icon on the far left that isn't displaying either. In Firefox I'm not seeing this at all while editing, but I take their word for it.
I tried changing the temporary directory from "/tmp" to "tmp" -- as mentioned in another post here -- but that didn't have any affect. I can't think of anything else to try on this end - any assistance would be much appeciated.
Jim
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | Picture 1_63.png | 67.1 KB | jimmb |
Comments
Comment #1
jpetso commentedad 1. I haven't yet heard of this, and would seriously like to see the example page as I find the explanation a bit hard to understand. However, your link leads to a 404 - perhaps I would have needed to be logged in?
ad 2. Your client is right, and the missing image on the left is the file type icon which does not exist in the ico/ folder. (This folder may contain images that are named [ext].png, where [ext] is the extension of the uploaded file.) It's a clear bug, covered in this issue, and I plan to rework filefield's file type icon system (and provide a few standard ones), but haven't yet come around to do it. Sorry for that, for now you need to supply icons like txt.png, pdf.png and the likes and put them into the ico/ folder, for each extension that you want this missing image not to show.
Comment #2
jimmb commentedThanks for your reply - I really appreciate it.
Question 2 - That is okay, I can find some generic icons and put them in the folder -- not a bad workaround :)
Question 1 - That's strange that you can't access the page. I can do so anonymously with no problems. If you want me to make an account for you to go in and take a look at anything from the admin side, let me know and I'll set it up.... I'm attaching a screenshot of that part of the page. It *is* a real problem and is happening without fail on this site.
Thanks,
Jim
Comment #3
jpetso commentedI tried again today and could access the page now. (But thanks for the picture, it nonetheless makes the bug report more useful.)
This is not standard filefield output, but seems to be themed. Consequently, standard filefield output HTML doesn't apply to this page. So my suspicion would be that the theming code does something wrong. Would you mind to post it here so we can take a look at what's wrong?
Comment #4
jimmb commentedHello,
We are using the ZenZen theme along with the ConTemplate module. The code from the "Page" ConTemplate is:
if ($node->field_link[0]['view'] || $node->field_files[0]['view']) :Additional Resources
if (!empty($node->field_link[0]['view'])) :print $field_link_0[0]['view']-print $field_link[0]['view']endif;if (!empty($node->field_files[0])) :print $field_files[0]['view']-print $field_file_description[0]['view']endif;endif;Hope that helps - let me know if you need anything else.
Jim
Comment #5
jimmb commentedHello - well, I think the problem was that permissions weren't set for that content. Somehow the obvious thing got overlooked. At any rate, the downloads are showing up now :)
But one last question - as far as putting the file icons in an ico folder, could you please elaborate a bit? Where exactly does the folder get made, is it called " ico ", and do you have to give a certain name to the graphic for it to be recognized?
Thanks again,
Jim
Comment #6
jpetso commentedOh cool, that's good to know. I guess I can close the issue then :)
As for the "ico" folder, it seems the packaging scripts don't package this folder so it only exists in CVS but not in release tarballs. Hm.
So, the folder is indeed called "ico" and lies inside the filefield module directory. Icon files need to be named {ext}.png, where {ext} is the file extension, that is, the part of the filename behind the last dot. For example, if someone uploads a file called README.first.txt, then you need a file txt.png in the ico directory which is then displayed on the edit page. If no further theming is done, nothing happens to the actual node view HTML output.
I hope that clears up this issue as well. Expect the filetype icon stuff to change in one of the next releases, though.
Comment #7
jimmb commentedThanks - that clears up the ICO question -- at least conceptually. However, I did what was suggested and I'm still not seeing the .pdf icon showing up. If I understand it, It's supposed to appear in the output page, for example:
http://www.blindmicemedia.com/dev/dublin/staging/business_advantages-ins...
Somewhere either before or after the download link. At this point it's a small issue and the client has actually given up on that feature.... But I am still curious why I can't get that to work.
Jim
Comment #8
jpetso commentedNo, it only appears in the node edit form, not in the node view. (Sorry for not communicating this more clearly.)
I am not familiar with contemplate, and I don't completely get your template (it also doesn't help that it has been rendered to HTML on this page, but that's not the big issue of course). But, with a little luck, you should be able to get the icon prepended to the download link by replacing
with
That might not produce the most standard compliant XHTML (I'm not really sure if the icon's div tags are allowed inside list items) but that's not really my cup of coffee here and I'm quite positive that you get the icon then. Everywhere you need it, you'd insert
theme('filefield_icon', $file)where $file needs to be the file array of that particular file, in your specific case I believe this is $field_files[0].Tell me if it worked :)
Comment #9
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #10
miles28 commentedprint the first uploaded file.
In case of multiple values I could use:
if ($field_files[1]):print theme('filefield_icon', $field_files[1]) . $field_files[1]['view']endif;etc
But, is there any better code method to get icons for file field with multiples values?
(I have tried to use this patch http://drupal.org/node/196957#comment-826888 with no luck)
Thanks in advance.
Comment #11
jpetso commentedIf the patch there didn't work for you, please follow up in that issue and try to help find out what's wrong with it. Did you apply the patch to the latest DRUPAL-5--2 branch of the CVS version? If not then it won't work because no default icons are shipped in the currently released versions. (Please continue the discussion in the issue that you linked to.)