I’ve done a quick search of this thread, but couldn’t find any mention of this problem. But apologies in advance if it’s already been addressed.
I’ve got an issue where I can upload an image via the CP and I can see it in the CP, verify that it exists in the server directory, can navigate to it via its URL, etc. However, when I try an include the image in my template via the custom field, nothing’s there.
In other words, I have a custom field called “Page Photo” with the short name of “page_photo”. However, when I include the custom field in my template like so, nothing happens:
{page_photo}
I’m doing something similar on other templates with other weblogs, with no problem. The only difference that I can think of is that the weblog that this field is associated with is being managed via the Structure module (i.e., I’m using it for “static” pages).
I’m using FieldFrame 1.1.3 and nGen File Field 0.9.8. Also, to add some further excitement to the mystery, the site in question is using MSM to manage two sites. And on the second site, the above code works just fine.
Well, that was dead-obvious. A bug ate the jQuery extension. (The language file was still there, but not the extension - weird.)
(For future reference - you must have nGen/Ellis Lab’s jQuery for the CP installed: http://www.ngenworks.com/software/ee/cp_jquery/ for nGen File Field to work)
Thanks, Fred!
Not sure whats going on? Was working last week, and now I’m getting these fatal errors:
Warning: exif_imagetype(/var/www/vhosts/domain.com/httpdocs/assets/products/logos/f) [function.exif-imagetype]: failed to open stream: No such file or directory in /var/www/vhosts/domain.com/httpdocs/system/extensions/fieldtypes/ngen_file_field/ft.ngen_file_field.php on line 742
Warning: unlink(/var/www/vhosts/domain.com/httpdocs/assets/products/logos/f) [function.unlink]: No such file or directory in /var/www/vhosts/domain.com/httpdocs/system/extensions/fieldtypes/ngen_file_field/ft.ngen_file_field.php on line 335
Fatal error: Cannot unset string offsets in /var/www/vhosts/domain.com/httpdocs/system/extensions/fieldtypes/ngen_file_field/ft.ngen_file_field.php on line 340
OK this is weird. I’m using the File Field to upload images to entries. Everything was working fine until this afternoon - the image was outputting into the template code (where it was being sized by the Image Sizer plugin). Now, no image is being output. I’ve already tested to make sure Image Sizer isn’t to blame (it isn’t - the image still doesn’t output when I remove the reference to Image Sizer in the template), and I’m not sure where to look next.
I have the same template code, same markup, same images in the same entries as I did 6 hours ago. Nothing changed in the site at all. Only now, I don’t see any images, and 6 hours ago I did!
Oddly, I added another file field as a test, uploaded the SAME image as is in my original file field and called the new field name in my template code and it worked perfectly again. It’s almost as if it’s suddenly stopped displaying any images uploaded to the field called {main_image}.
Bizarre.
Edited to add version information: FieldFrame: 1.1.2 nGen File Field: 0.9.8 EE: 1.6.7 20090515
This add-on is great - very exciting.
I have one bug, which is that when I upload a file from the entry editor (publish and edit), in the control panel, the file can upload successfully, and I can click on the link to the image and view the image in the browser… BUT, there is no preview of the image shown in the entry editor. I looked at the rendered code through firebug, and it turns out that the path is being created incorrectly:
<a href="http://mydomain.com/images/uploads/team/dan.jpg%22class=%22ngen-file-link" class="ngen-file-link" target="_blank" rel="noopener">_http://mydomain.com/images/uploads/team/_dan.jpg_</a>
See how the image path is only the folder, and then the file name is outside the image tag?
Do you know what this is? I suppose it isn’t the end of the world, but I’d like to be able to pass this off to the client with as high ease of use as possible, and image previews help quite a bit.
I also checked if it was my upload directory preferences, by uploading an image through the default ‘upload file button’, into the same directory, and it appears without issue in the control panel.
The picture appears with no problem when I display it in the template.
Thanks!
negs, I have a similar problem, but in reverse. My images appear fine in the control panel, but in my template, the directory path is not there at all. In my template I have {home_photo}, which used to render the entire path to the image, but now I had to change the template to images/uploads/site-images/{home_photo}. The image appears fine in the control panel, just not the templates. This isn’t a huge issue, but doesn’t make it as easy to manage assets if I have to hard code the directory in the template.
My nGen file field, which is required, is not being recognised as a required field. I can save without uploading a file. Any ideas?
@Siebird I was having a similar problem as you - it was working before and then it wasn’t - but now that problem has gone and I have a new one!!! I had a fiddle around with settings to do with the nGen file field being a required field, and now I’m not getting that error anymore, but my error started “Warning: getimagesize” [and referred to the ft.ngen_file_field.php file].
I wonder if there’s anyway we can cut down on the number of queries run by File Field? I have a page displaying 40 images, which are being resized by Image Sizer. I’m getting 80 identical queries run like so:
SELECT * FROM exp_upload_prefs WHERE id = 2
I’m no MysQL whiz, but there must be some way to cache the upload path for a field?
Regardless - excellent extension, incredibly valuable - thanks.
Derek
Ok, so I’m pretty sure the doubled up subfolder problem is stemming from this line in ft.ngen_file_field.php
$upload_prefs['server_url'] = $FNS->remove_double_slashes( $PREFS->ini('site_url') . $upload_prefs['server_uri'] );
Does anyone with some PHP skills have any ideas why?
Thanks in advance!
New release! - Several bug fixes - New parameter, show=”filename” to show only the file name - New feature, preview selected image when using existing files
Download v0.9.9 + Documentation: http://www.ngenworks.com/software/ee/ngen-file-field/
First of all, thanks for this “gem filetype” it’s really awsome !
2 Small problems here:
Notice: Undefined property: Ngen_file_field::$upload_prefs in G:\weblocal\www\blog\system\extensions\fieldtypes\ngen_file_field\ft.ngen_file_field.php on line 310
Could anyone point me to a solution ? I have looked at my upload paths and they haven’t changed (Working on a local WAMP install). The message appears every time I edit the properties of any field.
Reverted back to the previous working version (0.9.7). With 0.9.8 I had the duplicate folder bug mentioned above (was ok if a relative path was specified instead of an absolute one for the upload dir).
*** UPDATE: everything was solved using the v0.9.10 ! Many thanks to Fred Boyle for the super quick and efficient support.
@bobh
What version of imgsizer are you using ? Some of us had the same folder duplication problem a while back with that plugin. Was solved by upgrading. Have a look to the linked thread … HTH
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.