After upgrading to ImageField 6.x-3.0-beta3, I'm unable to upload any images. However, i did notice that if I disable javascript I'm able to upload images.

1. CCK 6.x-2.2
2. ImageField 6.x-3.0-beta3
3. tmp and files permissions set to 777
4. Public download method
5. Not required. Number of values: 1.
6. I expect a thumbnail to show up after I select an image and click the upload button.
7. When I click the upload button the image form blinks (fades out/in), but no thumbnail shows up. When I save the node the image is not saved/uploaded.
8. Just the usual steps to upload an image.

Comments

quicksketch’s picture

Thanks for the report. Since this looks like it might be a JavaScript issue, it's important to know, what browser/platform are you using? What other modules are modifying the node form (WYSIWYGs, other CCK fields, etc)?

deverman’s picture

My photographer also experienced this problem. He thought that upload was successful and said he didn't see any error message. I believe he was using IE. Not sure what version.

quicksketch’s picture

Does this happen with every image? This sounds like it might be the same as #356009: Large Uploads Cause Form to Disappear

thulstrup’s picture

Thanks for your input!

I finally managed to track down the problem to a theme_button function in my template.php file.

I was using the code from this post to wrap all submit buttons in span-tags. For some reason that made imagefields ajax upload fail.

function phptemplate_button($element) {
  // Make sure not to overwrite classes.
  if (isset($element['#attributes']['class'])) {
    $element['#attributes']['class'] = 'form-'. $element['#button_type'] .' '. $element['#attributes']['class'];
  }
  else {
    $element['#attributes']['class'] = 'form-'. $element['#button_type'];
  }

  // We here wrap the output with a couple span tags
  return '<span class="button"><span><input type="submit" '. (empty($element['#name']) ? '' : 'name="'. $element['#name'] .'" ')  .'id="'. $element['#id'].'" value="'. check_plain($element['#value']) .'" '. drupal_attributes($element['#attributes']) ." /></span></span>\n";
}
quicksketch’s picture

Ah! Yes this was caused by the JavaScript added in #370015: Upload issue with clicking 'Add another item' multiple times (Repost w/ screencast). It needs to be made a bit more flexible so that it doesn't break quite so easily with theming changes. I should have remembered to suggest changing to a default theme to see if that helps the problem.

thulstrup’s picture

Status: Active » Closed (fixed)

Yes, changing to a default theme helped me find the root of the problem.
Also I added a simple check to the theme function, so imagefield buttons doesn't get wrapped in spans.

Thanks for your time and keep up your great work!

deverman’s picture

I don't think we are using the method above but our problem happens when we choose an image and instead of clicking the upload button we head straight down to the save button. In the past the image was uploaded without using the upload button now they only way we can get it to work is to use the upload button.