OK, I have tried this on two different installs of 4.7.2 with cck cvs and i am getting the same bug. I can add an imagenode no problem. I can attach an image to a custom node also no problem. When I edit an already existing node with an image, the image dissapears. On one install i get no error, just the disappearing image. I can go back and re-attach an image and it will work fine, but as soon as I try to edit the node again the image disappears again. On the other install i get this error message:

array_merge() [function.array-merge]: Argument #2 is not an array in c:\Inetpub\wwwroot\drupal\modules\cck\imagefield.module on line 172.

the two installs are running on different servers. the one throwing the error is a windows machine, the one not throwing an error is a nix machine running apache. any help would be appreciated.

thanx,
thom

Comments

dopry’s picture

Which exact version of image field/cck are you using?
Are there any errors in watchdog?

onepairofpants’s picture

dopry,

CCK:
content.module,v 1.64 2006/06/12 19:36:54 JonBob Exp

Imagefield:
imagefield.module,v 1.2 2006/07/07 21:04:18 dopry Exp

Thanks for all your work on this. It is exactly what I need and is working great except for this little glitch.

Let me know if you need any more info.

Thanks again,
Thom

dopry’s picture

If you upgraded the modules, either imagefield or cck, you may need to remove then re-add the field to the content type. The way cck handles tables/columns for fields changed with 1.63 & 1.64. I'm unable to reproduce locally.

onepairofpants’s picture

dopry,

I tried that. Also tried a new content type with only imagefield and textfield. Same problem. I tried updating the database (???) still the same problem. I did update both modules though. perhaps i missed something? any other thoughts? I am pretty much lost at this point.

Thanks,
Thom

dopry’s picture

did you run update.php?

onepairofpants’s picture

yes.

stanbroughl’s picture

I have the same versions installed and am also getting this error of images disapearing on editing my page.

marcoBauli’s picture

Yes, same on me on CCK 1.64 and Imagemodule 1.33

Once i edit my content types the image disappears. If i then go to edit page again, it is no more listed in the "attach" field, which is blank..

Note: this happens also just previewing the node, where the red warning "If a new image is chosen, the current image will be replaced upon submitting the form." appears.
Is like if when editing, a new "blank" image is attached.

onepairofpants’s picture

I am getting the same errors as you guys. At least I am not alone. I though perhpas there was something wrong with my install. I was going to try a fresh install and see if i could recreate the problem. has anyone tried this yet?

-thom

dopry’s picture

I've got a site that I can reproduce the error on... I will have time to work on it on friday. Its an issue with the per-field session identifier or one of the session clearing functions most likely.

stanbroughl’s picture

a fresh install makes no difference, it doesn't seem to hold onto the image details properly on editing a page - the image stays in the files/images folder though so it's not deleting it from there

da312’s picture

I have this same problem, if you edit a page with a photo and leave the photo field blank it will delete the photo...

onepairofpants’s picture

dopry,

thanks for looking into this. is there anything i can do to help? i am a designer not a developer but i am willing to do testing or whatever i can....

thanks again,
thom

dopry’s picture

Assigned: Unassigned » dopry
Status: Active » Fixed

This should be fixed in cvs version 1.3.

da312’s picture

Does it fix the problem for anyone? It didn't seem to change for me. I downloaded CVS verson 1.3, uploaded it, and ran update.php.

The only thing that seems to have changed is that it says, "This image will be removed from Drupal and Replaced on submit."

I uploaded an image, it worked. I edited the page again, but left the field blank and the image was deleted.

Am I doing something wrong?

dopry’s picture

you're using the cvs head version of cck, and version 1.3 of imagefield module from contributions/modules, not my sandbox yes?

dopry’s picture

ok now try with 1.6... I put a > 1 in the wrong place. waiting on webchick to confirm.

webchick’s picture

Confirmed; seems to be working great now, thanks! :)

da312’s picture

1.6 fixed it up for me too! thanks

marcoBauli’s picture

yay! works!

stanbroughl’s picture

Excellent! You are a star!

netskaven’s picture

The problem is back. I'm using imagefield latest imagefield (19-07-2006) and cck (19-07-2006)

tones’s picture

I'm having a similar problem with a fresh install of CVS HEAD:
content.module,v 1.49 2006/04/18 and imagefield.module,v 1.8 2006/07/18

Clicking 'attach' reloads the page and displays the "filename:foo.gif" message, but the image is broken (empty black borders in Firefox, the broken window-pane image in MSIE). When I click 'submit' and then 'edit', no image is attached. If I look in the filesystem directly, I can see the image file (foo.gif) present in my '/files/' directory.

marcoBauli’s picture

@Tones: be sure to modify the .htaccess file in the /files directory, as explained in the readme (or install, can't remember..) file!
same happened to me and that fixed the problem

netskaven’s picture

all working now, thanks for the tip

Anonymous’s picture

Status: Fixed » Closed (fixed)