Ubercart & Imagecache not playing nice together

Project:Ubercart Contributions
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:active
Description
Project: 
Ubercart

Ubercart: 6.x-2.0-rc3
Imagecache: 6.x-2.0-beta9

Getting errors and images not appearing.

I had a similar issue as this before and somehow resolved it with permissions / etc.

Site was turned over to the clients and now it's broken again. I know the permissions on /files and /files/imagecache were changed to being un-writable and I fixed that yesterday but errors are still popping up in my log.

Type imagecache
Date Thursday, June 18, 2009 - 12:58
User Anonymous
Location http://ottawapaddleshack.ca/shop/sites/default/files/imagecache/uc_thumb...
Referrer http://ottawapaddleshack.ca/shop/catalog/25
Message Failed generating an image from files/noimage_23.jpg using imagecache preset uc_thumbnail.
Severity error
Hostname 70.49.33.131
Operations

Type imagecache
Date Thursday, June 18, 2009 - 12:58
User Anonymous
Location http://ottawapaddleshack.ca/shop/sites/default/files/imagecache/uc_thumb...
Referrer http://ottawapaddleshack.ca/shop/catalog/25
Message Failed to create imagecache directory: sites/default/files/imagecache/uc_thumbnail/files
Severity error
Hostname 70.49.33.131
Operations

Version: 
Ubercart 2.0-RC1
rojesaga's picture
Offline
Joined: 08/29/2009
Juice: 9
ImageCache

Drupal 6.13
MySQL 5.0.77
PHP 5.2.9
Web Server Apache 2.2
Ubertcart 6.x-2.0-rc6
CCK 6.x-2.5
FileField 6.x-3.1
Image 6.x-1.0.alpha6
ImageCache 6.x-2.0-beta10
ImageField 6.x-3.1

Every time y try to upload a image to my produc catalog in Ubercat, display this error. And no image upload.

{ "status": true, "data": "\x3cdiv id=\"edit-field-image-cache-0-ahah-wrapper\"\x3e\x3cdiv class=\"form-item\" id=\"edit-field-image-cache-0-wrapper\"\x3e\n \x3cdiv class=\"filefield-element clear-block\"\x3e\x3cdiv class=\"widget-preview\"\x3e\x3cdiv class=\"imagefield-preview\"\x3e\x3cimg src=\"http://futosa.com.mx/portal/system/files/imagefield_thumbs/casting-quote.jpg\" title=\"casting-quote.jpg\" /\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class=\"widget-edit\"\x3e\x3cinput type=\"hidden\" name=\"field_image_cache[0][fid]\" id=\"edit-field-image-cache-0-fid\" value=\"246\" /\x3e\n\x3cdiv class=\"form-item\" id=\"edit-field-image-cache-0-data-alt-wrapper\"\x3e\n \x3clabel for=\"edit-field-image-cache-0-data-alt\"\x3eAlternate Text: \x3c/label\x3e\n \x3cinput type=\"text\" maxlength=\"80\" name=\"field_image_cache[0][data][alt]\" id=\"edit-field-image-cache-0-data-alt\" size=\"60\" value=\"\" class=\"form-text imagefield-text\" /\x3e\n \x3cdiv class=\"description\"\x3eThis text will be used by screen readers, search engines, or when the image cannot be loaded.\x3c/div\x3e\n\x3c/div\x3e\n\x3cdiv class=\"form-item\" id=\"edit-field-image-cache-0-data-title-wrapper\"\x3e\n \x3clabel for=\"edit-field-image-cache-0-data-title\"\x3eTitle: \x3c/label\x3e\n \x3cinput type=\"text\" maxlength=\"500\" name=\"field_image_cache[0][data][title]\" id=\"edit-field-image-cache-0-data-title\" size=\"60\" value=\"\" class=\"form-text imagefield-text\" /\x3e\n \x3cdiv class=\"description\"\x3eThe title is used as a tool tip when the user hovers the mouse over the image.\x3c/div\x3e\n\x3c/div\x3e\n\x3cinput type=\"hidden\" name=\"field_image_cache[0][list]\" id=\"edit-field-image-cache-0-list\" value=\"1\" /\x3e\n\x3cinput type=\"submit\" name=\"field_image_cache_0_filefield_remove\" id=\"edit-field-image-cache-0-filefield-remove\" value=\"Remove\" class=\"form-submit\" /\x3e\n\x3c/div\x3e\x3c/div\x3e\n\x3c/div\x3e\n\x3c/div\x3e\x3cscript type=\"text/javascript\"\x3ejQuery.extend(Drupal.settings.ahah, { \"edit-field-image-cache-0-filefield-upload\": { \"url\": \"/portal/filefield/ahah/product/field_image_cache/0\", \"event\": \"mousedown\", \"keypress\": true, \"wrapper\": \"edit-field-image-cache-0-ahah-wrapper\", \"selector\": \"#edit-field-image-cache-0-filefield-upload\", \"effect\": \"fade\", \"method\": \"replace\", \"progress\": { \"type\": \"throbber\" }, \"button\": { \"op\": \"Upload\" } }, \"edit-field-image-cache-0-filefield-remove\": { \"url\": \"/portal/filefield/ahah/product/field_image_cache/0\", \"event\": \"mousedown\", \"keypress\": true, \"wrapper\": \"edit-field-image-cache-0-ahah-wrapper\", \"selector\": \"#edit-field-image-cache-0-filefield-remove\", \"effect\": \"fade\", \"method\": \"replace\", \"progress\": { \"type\": \"throbber\" }, \"button\": { \"field_image_cache_0_filefield_remove\": \"Remove\" } }, \"edit-field-image-cache-1-filefield-upload\": { \"url\": \"/portal/filefield/ahah/product/field_image_cache/1\", \"event\": \"mousedown\", \"keypress\": true, \"wrapper\": \"edit-field-image-cache-1-ahah-wrapper\", \"selector\": \"#edit-field-image-cache-1-filefield-upload\", \"effect\": \"fade\", \"method\": \"replace\", \"progress\": { \"type\": \"throbber\" }, \"button\": { \"op\": \"Upload\" } }, \"edit-field-image-cache-1-filefield-remove\": { \"url\": \"/portal/filefield/ahah/product/field_image_cache/1\", \"event\": \"mousedown\", \"keypress\": true, \"wrapper\": \"edit-field-image-cache-1-ahah-wrapper\", \"selector\": \"#edit-field-image-cache-1-filefield-remove\", \"effect\": \"fade\", \"method\": \"replace\", \"progress\": { \"type\": \"throbber\" }, \"button\": { \"field_image_cache_1_filefield_remove\": \"Remove\" } } });\x3c/script\x3e" }

kriskhaira's picture
Offline
Joined: 05/25/2010
Juice: 10
#2
Category:» bug report
Assigned to:rojesaga» Guest

I'm getting the same error. Have you both solved your issue? If so, how?

Drupal 6.16
CCK 6.x-3.3
ImageAPI 6.x-1.8
ImageCache 6.x-2.0-beta10
Ubercart 6.x-2.2

The error I get is similar to the one in the post above: http://pastie.org/977546

kriskhaira's picture
Offline
Joined: 05/25/2010
Juice: 10
#3

Just to add, I tried the following steps in order but I still get the same problem:

1. Disabled, uninstalling and then re-enabling Ubercart, ImageCache and ImageAPI
2. Deleted the product content type
3. Re-enabled all the related modules

Still the same problem :/

alien73's picture
Offline
Bug Finder
Joined: 11/10/2007
Juice: 450
#4

Sounds like a permission problem to me double check that their writeable

kriskhaira's picture
Offline
Joined: 05/25/2010
Juice: 10
#5

My permissions are fine. sites/default/files is chmod to 777 along with all the folders down that path.

kriskhaira's picture
Offline
Joined: 05/25/2010
Juice: 10
#6

I've fixed it Smiling Thanks to all who helped. It was because of white space in my templates.php file outside the PHP section.

Pauli's picture
Offline
Joined: 10/19/2010
Juice: 2
#7

I also have the same problem with no solution so far.
I have a multi-image imagefield and when I try to add another image I get the same cryptic text:

{ "status": true, "data": "\x3cdiv id=\"edit-field-gallery-5-ahah-wrapper\"\x3e\x3cdiv class=\"form-item\" id=\"edit-field-gallery-5-upload-wrapper\"\x3e\n \x3cdiv class=\"filefield-element clear-block\"\x3e\x3cdiv class=\"widget-preview\"\x3e\x3cdiv class=\"imagefield-preview\"\x3e\x3cimg src=\"http://smilebulgaria.org/sites/default/files/imagefield_thumbs/ddim7-_1.png?1287530221\" title=\"ddim7-.png\" alt=\"Image preview\" /\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class=\"widget-edit\"\x3e\x3cinput type=\"hidden\" name=\"field_gallery[5][fid]\" id=\"edit-field-gallery-5-fid\" value=\"80\"
(etc. etc.)

One workaround I've found is to interrupt the upload process in the middle by clicking "Add another image" button or "Preview node" button. Then the image is uploaded OK and I can use it.

Is there a solution to this problem?

(I've looked at the template.php in my theme but no apparent problems were found there. The problem does not appear to be dependant on specific browser - it doesn't work in Firefox and Chrome for example)