1. cck 6.x-2.1
2. imagefield 6.x-3.0-beta1
3. tmp read/write
4. public downloads
5. imagefield 6.x-3.0-alpha4 configured by ubercart, then updated to 6.x-3.0-beta1
6. imagefield image upload
7. IE6: image upload works only with javascript enabled (via ajax). image deletion works only with javascript disabled (via full request)
8. check this on IE6 on common config.

CommentFileSizeAuthor
#28 dim_length.patch4.53 KBIsland Usurper
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quicksketch’s picture

Thanks for the report. The image upload only working when JavaScript is enabled has been fixed in #403216: Upload fails when JS is disabled. I'll look into deleting in IE6. I'm guessing that you're implying that all other browsers work fine when deleting images?

quicksketch’s picture

Using the latest CVS version (with the #403216: Upload fails when JS is disabled patch applied), I'm not able to confirm this problem. IE6 works uploading/removing/saving images with or without JavaScript.

aks’s picture

Firefox works fine! I'll try latest CSV version to fix #403216: Upload fails when JS is disabled

quicksketch’s picture

Note you'll need the latest version of FileField, which is where the no-JS bug actually originated.

aks’s picture

I've applied the patch to filefield, it had effect that IE is able to upload/delete without JS, but still can't delete with JS. It seems that ajax call works (imagefield item disappeared in list after clicking 'delete'), and real deletion does not.

quicksketch’s picture

It seems that ajax call works (imagefield item disappeared in list after clicking 'delete'), and real deletion does not.

What do you mean by "real deletion"? The file isn't actually removed from the node or disk until the node is saved.

rsm08’s picture

I seem to have a similar problem, so I'll join this thread.

When adding or editing a node with a CCK imagefield (with multiple images allowed), :

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).

I'm using:
Drupal 6.9
CCK 6.x-2.1
ImageField 6.x-3.0-alpha4

Hope you can help, thanks!

quicksketch’s picture

rsm08, you'll need to upgrade to at least beta3 before we'll be able to help you. The problem you're reporting very well may have already been fixed. Upgrading to CCK 2.2 is also highly recommended, since it corrects an issue with the "more" button breaking uploads.

rsm08’s picture

quickstetch, thanks, I was trying to avoid the beta versions, but I'll try your advice and report my findings here.

drewish’s picture

i've got to chuckle at being willing to use alpha software but being scared off by beta

rsm08’s picture

Oh, I didn't notice it was an alpha version. ;) What I meant was that I was trying to avoid dev versions if there was a safe but earlier version available!

Well, I updated, and though the upload interface is now nicer and simpler than before, the javascript problem remains the same. The instance I click "Add another item", the whole imagefield area disappears without a page reload.

Note that the problem is still only in IE7. FF works fine.

My versions are now:
CCK 6.x-2.2
ImageField 6.x-3.0-beta3
ImageAPI 6.x-1.5
ImageCache 6.x-2.0-beta8
Ubercart 6.x-2.0-beta5

Hope you can help!

quicksketch’s picture

Are you having trouble with Ubercart ImageFields, or is it all ImageField's in general? I know Ubercart had to do some changes when the beta versions of ImageField came out, see #404352: Image (field_image_cache) is an inactive image field.

I ask because I can't reproduce this problem at all. On my sandbox uploading/removing/add another item all work just fine on IE7 and even on IE6. Are you logged in as the same user in both FF and IE?

rsm08’s picture

Actually it's only Ubercart imagefields. I tried this in another content type, and there was no problem.

So it's only in Ubercart's content types that this problem occurs. I guess I'll have to take this issue to Ubercart's site then.

Thanks for helping me out!

quicksketch’s picture

Title: Ajax bug on upload/delete image » Ajax bug on upload/delete Ubercart images
Category: bug » support
Priority: Critical » Normal
Status: Active » Closed (fixed)

Great, thanks for the followup. It seems like the Ubercart folks have fixed this just recently in that issue I posted above.

rsm08’s picture

But this issue you posted, I can't see how this has anything to do with my problem!?

As I understand it, the mentioned issue has something to do with problems caused by updating imagefield, and I had this problem before I updated either module!

Am I missing something here?!

chumm’s picture

I am experiencing the same issue with IE7 and IE8.

In all browsers (IE7, IE8, Firefox), clicking the 'REMOVE' button associated with the image does appear to remove the image from the edit page. Then as usual, when clicking 'SAVE' at the bottom, the product page shows up once again. However, if using IE, the image is not deleted and still displays.

This is NOT the case with Firefox. Firefox works as it should.

Can anyone offer some help with this, as I need it to work in IE. I tried searching the forms for can't delete images ie and didn't see anything relevant to my issue.

For reference, I'm running the following which Drupal reports are all up to date:
Drupal 6, Ubercart 2
Content 6.x-2.2
FileField 6.x-3.0-rc1
ImageField 6.x-3.0-rc1
ImageAPI 6.x-1.5
ImageCache 6.x-2.0-beta8

chumm’s picture

Status: Closed (fixed) » Active

I meant to re-open this in my last post.

quicksketch’s picture

I'm at a loss for what's wrong here. Any other Ubercart users please post if you're having trouble or what can be done to solve the problem. I'm leaving this up to the Ubercart team to solve this problem, since I'm not going to install an entire e-commerce site just to test out FileField. It works fine on normal node posts in all browsers.

chumm’s picture

Is there anything that I could do to try and debug? I'm surely not a programmer but would be willing to help out to test/debug this if it can help lead to a fix.

chumm’s picture

I tried a completely fresh Drupal and Ubercart install. This problem continues to exist! My experiences below:

Installed Drupal 6.9 through my webhost. Then I immediately updated it to v6.10.

Then I uploaded all the Ubercart files (v6.x-2.0-beta5) and installed the latest Ubercart modules. I went to enable image support and got the following error messages:

    * user warning: Duplicate entry 'field_image_cache' for key 1 query: INSERT INTO content_node_field (field_name, type, global_settings, required, multiple, db_storage, module, db_columns, active, locked) VALUES ('field_image_cache', 'image', 'a:3:{s:10:\"list_field\";s:0:\"\";s:12:\"list_default\";s:1:\"0\";s:17:\"description_field\";s:0:\"\";}', 0, 1, 0, 'filefield', 'a:3:{s:3:\"fid\";a:2:{s:4:\"type\";s:3:\"int\";s:8:\"not null\";b:0;}s:4:\"list\";a:3:{s:4:\"type\";s:3:\"int\";s:4:\"size\";s:4:\"tiny\";s:8:\"not null\";b:0;}s:4:\"data\";a:2:{s:4:\"type\";s:4:\"text\";s:9:\"serialize\";b:1;}}', 0, 0) in /home/samplesite/public_html/includes/common.inc on line 3422.
    * user warning: Duplicate entry 'field_image_cache-product' for key 1 query: INSERT INTO content_node_field_instance (field_name, type_name, weight, label, widget_type, widget_settings, display_settings, description, widget_module, widget_active) VALUES ('field_image_cache', 'product', -2, 'Image', 'imagefield_widget', 'a:12:{s:15:\"file_extensions\";s:20:\"gif jpg jpeg png bmp\";s:9:\"file_path\";N;s:21:\"max_filesize_per_file\";N;s:21:\"max_filesize_per_node\";N;s:14:\"max_resolution\";N;s:14:\"min_resolution\";N;s:3:\"alt\";N;s:10:\"custom_alt\";s:1:\"1\";s:5:\"title\";N;s:12:\"custom_title\";s:1:\"1\";s:13:\"default_image\";N;s:17:\"use_default_image\";N;}', 'a:4:{s:5:\"label\";a:1:{s:6:\"format\";s:6:\"hidden\";}s:6:\"teaser\";a:1:{s:6:\"format\";s:6:\"hidden\";}s:4:\"full\";a:1:{s:6:\"format\";s:6:\"hidden\";}i:4;a:1:{s:6:\"format\";s:6:\"hidden\";}}', '', 'imagefield', 1) in /home/samplesite/public_html/includes/common.inc on line 3422.

Then I uploaded all the latest Ubercart dev version files (6.x-2.x-dev) and ran the update.php script.

Then I went to enable image support once again and this time got the following errors:


    * user warning: Duplicate entry 'field_image_cache' for key 1 query: INSERT INTO content_node_field (field_name, type, global_settings, required, multiple, db_storage, module, db_columns, active, locked) VALUES ('field_image_cache', 'filefield', 'a:3:{s:10:\"list_field\";s:1:\"0\";s:12:\"list_default\";i:1;s:17:\"description_field\";s:1:\"0\";}', 0, 1, 0, 'filefield', 'a:3:{s:3:\"fid\";a:2:{s:4:\"type\";s:3:\"int\";s:8:\"not null\";b:0;}s:4:\"list\";a:3:{s:4:\"type\";s:3:\"int\";s:4:\"size\";s:4:\"tiny\";s:8:\"not null\";b:0;}s:4:\"data\";a:2:{s:4:\"type\";s:4:\"text\";s:9:\"serialize\";b:1;}}', 1, 0) in /home/samplesite/public_html/includes/common.inc on line 3422.
    * user warning: Duplicate entry 'field_image_cache-product' for key 1 query: INSERT INTO content_node_field_instance (field_name, type_name, weight, label, widget_type, widget_settings, display_settings, description, widget_module, widget_active) VALUES ('field_image_cache', 'product', -2, 'Image', 'imagefield_widget', 'a:12:{s:15:\"file_extensions\";s:11:\"gif jpg png\";s:9:\"file_path\";N;s:21:\"max_filesize_per_file\";N;s:21:\"max_filesize_per_node\";N;s:14:\"max_resolution\";N;s:14:\"min_resolution\";N;s:3:\"alt\";N;s:10:\"custom_alt\";i:1;s:5:\"title\";N;s:12:\"custom_title\";i:1;s:13:\"default_image\";N;s:17:\"use_default_image\";N;}', 'a:4:{s:5:\"label\";a:1:{s:6:\"format\";s:6:\"hidden\";}s:6:\"teaser\";a:1:{s:6:\"format\";s:6:\"hidden\";}s:4:\"full\";a:1:{s:6:\"format\";s:6:\"hidden\";}i:4;a:1:{s:6:\"format\";s:6:\"hidden\";}}', '', 'imagefield', 1) in /home/samplesite/public_html/includes/common.inc on line 3422.

Interestingly enough, it does say: Product image support has been automatically configured by Ubercart.

HOWEVER.... I am experiencing the exact same image problems as I am on my primary site. Images can be removed from products only when using Firefox. Doesn't work in IE. Also, my product images are missing the 'replace' image upload option.

Does anybody know what is going on here? This is quite frustrating.

quicksketch’s picture

Project: ImageField » Ubercart
Version: 6.x-3.0-beta1 » 6.x-2.x-dev
chumm’s picture

Version: 6.x-2.x-dev » 6.x-2.0-beta5

Update: Reverting to FileField 6.x-3.0-alpha7 and ImageField 6.x-3.0-alpha4 fixes the issue, and I can once again actually delete images that are associated with products.

Perhaps the developers of these modules can figure out what happened somewhere between these versions and the current ones.

Island Usurper’s picture

Version: 6.x-2.0-beta5 » 6.x-2.x-dev
Assigned: aks » Unassigned

Oh blargh.

I think it's got something to do with the product node form. There's nothing different (any more) about the image fields that Ubercart puts on products. I can add the existing field to other content types, and it works fine in IE (I'm using IE8). But, adding a new image to pages, and then adding that field to a product class causes the Remove button and "Add another item" to not work.

If someone can test with another node-type module (Event, maybe?), I'd like to know if that's the problem. I don't know what is unique about uc_product_form() that throws AHAH in IE for a loop.

Island Usurper’s picture

Category: support » bug
CandC540’s picture

I have the same problem with attaching multiple files breaking FileField

epop’s picture

joining this thread, i too cant delete images from products in IE. I have all the latest versions. This is a major issue. Other content types work fine its just Ubercart Products. So the problem must be with Ubercart and its interactions wit IE.

Island Usurper’s picture

Status: Active » Needs review

This is an amazing bug. I'm really fortunate that the IE 8 JScript debugger works even better than Firebug, or I might never have found it.

Some background: ahah.js uses a function called ajaxSubmit() from jquery.form.js to send the HTTP request. ajaxSubmit() takes the data it is given, and combines it with the form values on the page to send as POST data. And in the vast majority of cases, this works just fine.

However, to get the form values, ajaxSubmit() calls formToArray(). This function runs a for() loop on all of the elements of the form, and uses the els.length as the upper bound of the loop. Somehow, and only in IE, els.length isn't the numeric size of the array of elements, but the actual "length" form element. You can't compare objects as numbers, so the function returns an empty array, and the form values aren't included in the POST data.

When Filefield can't find $_POST['form_build_id'], it thinks the upload failed because the file was too big, and returns an error message saying so.

So, the most obvious solution is to change the name attribute of the length field. Because I like symmetry, I also changed the width and height fields. This should only affect the node-edit form. $node->length and friends should remain the same since uc_product_load() wasn't changed.

Island Usurper’s picture

FileSize
4.53 KB

And with a patch, this time.

fenstrat’s picture

Status: Needs review » Reviewed & tested by the community

Works perfectly.

Very, very strange bug.

Lyle your spot on - the culprit is the for loop which uses els.length as the upper bounds. The reason looks to be IE's reserved words. In particular length.

Interesting timing, I'd finally got some time to track this down and was just submitting a patch to change length to dimension_length just as you did (minus your consistency touch with width and height). Last minute search found this - you beat me too it, so still can't clame my first patch!

btw this also effects Opera.

Making these 2 as duplicates:
#448314: Unable to remove product images in IE or Opera
#435312: Getting error message when deleting images

Island Usurper’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for testing. Committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

asianguy’s picture

when UPS product description Package type is set to Customer Supplied Package, Product cant be saved because "Dimensions are required for custom packaging", it always ask for dimension even if dimension has values

5n00py’s picture

Status: Closed (fixed) » Needs work

#757724: Dimensions reset Look to this bug pls.
Patch from #28 NOT "Works perfectly."

5n00py’s picture

Patch from #404234-28: Ajax bug on upload/delete Ubercart images create new bug.
Patch store dimensions data in:
$node->dim_length,
$node->dim_width,
$node->dim_height
instead
$node->length
$node->width
$node->height
This looks good, but.

/**
 * Implementation of hook_load().
 */
function uc_product_load(&$node) {
  return db_fetch_object(db_query('SELECT model, list_price, cost, sell_price, weight, weight_units, length, width, height, length_units, pkg_qty, default_qty, unique_hash, ordering, shippable FROM {uc_products} WHERE vid = %d', $node->vid));
}

Function uc_product_load return data from db directly to node object and still use old variable names.

I see 3 possible ways to fix this:

  1. Change return data in uc_product_load. This way is simple.
  2. Change field name in database. Harder then first, but better.
  3. If this bug only for IE6 revert this patch

I think storing data from 'length' db column in variable named dim_length not good idea.

--
Sorry for my English :)

Summit’s picture

Subscribing, greetings, Martijn

longwave’s picture

Status: Needs work » Closed (fixed)

The original issue is fixed. The dimensions bug is open as another issue.