Hi,
I'm experiencing a strange problem with imagefield when adding or editing a product node:
In IE7, upload works fine, but when clicking the "Add another item" button to add fields for uploading another image, the whole imagefield part of the form just disappears.
The page doesn't reload, and there's no problem in Firefox, so it must be a javascript-issue. (Which leaves me clueless since I have no js debugger for IE).
This problem only occurs with Ubercart product nodes. Other nodes with identically configured imagefields work fine.
I'm using:
Drupal 6.9
Ubercart 6.x-2.0-beta5
CCK 6.x-2.2
ImageField 6.x-3.0-beta3
ImageAPI 6.x-1.5
ImageCache 6.x-2.0-beta8
Hope someone can help, thanks!
Comments
Comment #1
Island Usurper commentedThe way Ubercart 2.0-beta5 sets up the image field for products is incompatible with Imagefield 3.0-beta3. If you upgraded Imagefield after letting Ubercart create the field, it should be fine, though.
If you add another image field to the product type, and it doesn't have this problem, please post an export of those two fields. If it only works on a different content type, export that too.
Comment #2
rsm08 commentedHi IU
Actually, the reason I upgraded both ImageField and Ubercart was the occurrence of the problem, so it was there already, before the imagefields became filefields.
To answer your question though, I upgraded Imagefield after Ubercart had created the field.
I tried to add another image field to the product type, but this makes the same error.
I tried it on the "article" content type, and here were no problems. I'm still a drupal noob, so forgive me for asking stupid, but whats an "export" exactly and how do I make it?!
BTW, wouldn't it be more intuitive to have the form add a new blank image field automatically, every time an image is uploaded, so there is always a single empty field available, instead of having an "Add another item" button, which I'm afraid will just confuse users?
Comment #3
Island Usurper commentedIt might be more intuitive to do it that way. You should ask the people maintaining Imagefield in that module's issue queue. ;)
In the Content type settings there should be a tab called Export . This page lets you generate the PHP that defines the content types and their fields. Ubercart uses similar PHP to create the image field for the product type, so I want to see how it's different from what you have.
Comment #4
sam_RiteTimeDirect commentedYou say that UC beta 5 is incompatible with Imagefield 3.0-beta3. I have been trying to add an image to a product and keep getting an error Fatal error: Call to undefined function imagefield_content_is_empty() in /home/ritenec1/public_html/sites/all/modules/cck/content.module on line 900
Is this related to the general incompatibility?
Also, do you know if this issue is being worked out on either the ubercart or imagefield side of things? If not what is my work aournd to post images?
Thanks in advance.
Sam
Comment #5
Island Usurper commentedIt might be related, but I haven't seen that error before. Get the dev version of Ubercart. It will create the image field with the same data they expect, which includes telling CCK which module handles which part of the field storage and display.
Comment #6
sam_RiteTimeDirect commentedOK I found my problem. I had not run update php. Now everything will upload just get the error when I try to preview.
Comment #7
rsm08 commentedOk I found the export feature.
Here is an export of the "vareparti" content type which is a product class. Here the problem occurs:
And this is an export of the standard "story" content type with an imagefield added. This works fine:
I hope this will help, thanks!
Comment #8
rsm08 commentedBump
Comment #9
Island Usurper commentedThe "vareparti" type doesn't have any fields on it, it looks like. The "story" has
$content['fields'], but "vareparti" doesn't. That would mean you can't upload pictures to that type of product at all.Comment #10
rsm08 commentedI didn't take a closer looks at those exports, but I can see what you mean. However this must be a problem with the export mechanism itself, because there IS indeed an imagefield on this content type. The field works fine (besides the mentioned problem in IE7).
Instead of going into why export isn't working, I copied the $form['field_image_cache'] from dprint_r() from the "node/add/vareparti" url. As you can see, the field is there:
For comparative purposes, I did the same thing with "node/add/story" where the imagefield is working fine:
I hope that these data can give you some clues!
Comment #11
rsm08 commentedBump
Comment #12
rsm08 commentedBump
Comment #13
Island Usurper commentedThey look the same to me. All I can figure is that it's a weird bug in IE. You might try removing the image field from your product types and adding it back again, but that can cause you to lose all of your images.
Comment #14
rsm08 commentedI don't think removing the field and adding it again will do anything. Since it's a javascript problem, it must be caused by some DOM detail, where IE acts differently than it should. As we all know, debugging javascript in IE is a pain. I don't even have a debugger installed, so I'll have to go find one.
It must be something with the field's naming or placement in the DOM when it's a ubercart image in contrary to when it's just a regular filefield.
Maybe you can give me a clue as to what the difference is between the ubercart field_image_cache and a normal filefield, when displayed on the edit page?!
If I can't solve this, I'm gonna just change imagecache, so it adds a new field automatically after each upload instead of the current interface.
Comment #15
petr illekI have similar problem. In IE the field just disapear, but in FF i got the message:
Error occured.
/content/js_add_more/XXX
(no more information availaible)
Where XXX is the name of field.
Im suffering from this not only in product nodes, but in every content where I have the "add another item"
Any ideas what to do?
Comment #16
keesje commentedSame problem?: http://drupal.org/node/404234
Comment #17
keesje commentedStill applies 2.0 rc1.
FF3 works without warning.
I have IE7 + JS debugger, but no JS warning what so ever. Might be the debugger not debugging AJAX transactions ;).
Comment #18
rsm08 commentedIt wasn't exactly the same problem as the thread you quoted. In there the problem had to do with deletion of images. My problem was, that whenever I clicked the "Add another item" button, the whole filefiled would just disappear (javascript caused).
The problem was only in IE7 though - not FF.
What happened was, that suddenly it just worked, and now I can't reproduce the error anymore. I don't know if it will return, so I haven't gotten my hopes up yet. It could be all sorts of other modules interfering, so maybe I've removed some module that was messing this up. But I can't know for sure, and particularly not which module it was.
Debugging Drupal is sometimes like a game of mastermind with all those modules!
Comment #19
Island Usurper commentedSince this is also an IE problem, I suspect that the same fix will work for both issues. Try applying the patch at #404234-28: Ajax bug on upload/delete Ubercart images and see if it helps.
Comment #20
tr commentedAccording to #18 the OP no longer has the problem, and according to #19 this seems to have been fixed by #404234: Ajax bug on upload/delete Ubercart images. Since neither the OP nor anyone else has reported a problem in the 8 months since the fix, I'm going to consider this solved and close the issue.