Tried to upload default image but it didn't take.

deverman - June 6, 2009 - 02:09
Project:ImageField
Version:6.x-3.0
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

CCK version 6.x-2.2

Could not upload a default image for an image field in my cck content type. Image uploads when creating nodes with image fields work fine.

My files directory has the correct permissions.

Checked folder imagefield_default_images in files directory for image after upload but folder is empty. Both png and gif formatted images were not uploaded.

When editing the image field form it seems to save fine and no error is given but the image is not uploaded.

I see no error in the watchdog related to this.

Download method is public

AttachmentSize
Picture 9.png76.08 KB
Picture 10.png16.83 KB
Picture 11.png61.57 KB

#1

quicksketch - June 6, 2009 - 20:15

I can't reproduce this problem. Please excuse the obviousness of this suggestion, but you did save the field configuration after selecting an image right? I'm just not sure what to suggest since I can't make the same problem appear on my sandbox.

#2

deverman - June 7, 2009 - 03:24

Yes, I saved the field configuration. I am using firefox.

Here are permissions on my directory:

drwxrwxr-x 2 www-data www-data 4096 2009-05-05 07:11 imagefield_default_images

I am using the acquia distribution with the acquia theme for the admin functions.

I also do not see any error message in the apache error log.

It seems to save the checkbox setting but not the image setting.

The problem happens on different content types.

This website has been upgraded from drupal 5 to 6.

#3

deverman - June 21, 2009 - 04:14

Upgraded to newer acquia distribution and still have same problem:

Content 6.x-2.3
FileField 6.x-3.0-alpha7

FileField Meta 6.x-3.0-alpha7

FileField Tokens 6.x-3.0-alpha7

ImageField 6.x-3.0

Any new ideas?

#4

quicksketch - June 21, 2009 - 05:43

FileField 6.x-3.0-alpha7

The default image functionality was not available until RC1 of FileField. If you're running alpha7 of FileField, that'll likely have a lot of problems as versions of ImageField and FileField must match at all times to work properly.

#5

firfin - July 19, 2009 - 21:13

Experiencing the same or very alike problem.
Imagefields work fine on entire site. 'browse' an image. 'upload' it, 'save' the node. Done.

Except when setting the default value for an imagefield. When I manage the field, there is no 'upload' button in the default image fieldset. The checkbox (use default ) works ok.

Any more info you need please let me know.

Using
Drupal 6.12
FileField 6.x-3.0
ImageField 6.x-3.0
ImageCache 6.x-2.0-beta9

#6

deverman - July 20, 2009 - 15:31

We found it was a problem with an old version of the "FileField 6.x-3.0-alpha7 " module overriding the newer module and screwing things up. we accidentally had duplicated modules with our acquia installation.

#7

firfin - July 20, 2009 - 17:04

Thank you for your feedback deverman. I just disabled and deinstalled both filefield and imagefield. Then I completely removed their directories from /site/all/modules/ . Downloaded the 3.1 versions, unpacked and enabled them. So that should have cleared up any previous versions.

Unfortunately I still don't see an upload button when I try to set a default image.
Any others tips?

#8

quicksketch - July 20, 2009 - 18:15

firfin, there isn't an upload button, you just have to select a file and then save the settings.

#9

firfin - July 30, 2009 - 08:31

Oh no ... you're right! I was using a single png pixel with full transparancy. So it was actually showing up when I 'managed' the field, I just did not see it. Also the textfield was empty. I feel extremely dimwitted atm.

However, to add to the confusion:
When I create a new content of the contenttype with the image set, the field does not have the default image that I set. It doesn't have an image it all. It just shows the textfield with a browse and upload button.
When I save the new content without uploading an image there is indeed no image saved with the new node.

#10

quicksketch - July 20, 2009 - 19:41

ImageField doesn't actually associate an image with the content if no file is uploaded (so you never see the default on the edit screen), it's purely shown on output. The intention is to provide an image that is used if the field is left blank, rather than other fields where it would prepopulate the value of the form.

#11

firfin - July 20, 2009 - 20:57

Ok, let me see if I understand now.
You can create an contenttype, say product. Then you can add an imagefield 'productimage' When we manage this field we can set a defaultimage.
When we create or edit a 'product' and do not upload an image for productimage-field then the default image should show up in the resulting product-node.

This is how it should work?
It is more or less how I expect default image to behave. A bit counter-intiutive to me without prepopulating the field on the edit page, but that isn't a serious problem or hurdle.

It doesn't work that way for me. I set a default image for 'productimage', created a new 'product' , did not upload an image for 'productimage' and saved the 'product'. When I view the newly created product there isn't image to be seen.

What am I missing here?

Thanks for your help so far.

#12

nick_robillard - October 2, 2009 - 03:51

firfin, I had this same problem with 6.x-3.0 - the default image would not appear in node views that had no image uploaded. I tried what was suggested - I disabled and uninstalled filefield and imagefield but still no go.

Upgrading filefield and imagefield to 6.x-3.1 fixed it - nodes with no images uploaded now show the default image. Yay!

 
 

Drupal is a registered trademark of Dries Buytaert.