13 replies [Last post]
loocher's picture
Offline
Joined: 02/21/2009
Juice: 211
Was this information Helpful?

Drupal 6, Safari 3

Go to:

Home > Administer > Store administration > Products > Manage classes > (Create & Save new class with attributes. Has same name as previously deleted class)

Then

Home > Administer > Store administration > Products > Manage classes > View products

Causes error with multiple lines like this:

user warning: Unknown column 'delta' in 'order clause' query: SELECT * FROM content_field_image_cache WHERE vid = 109 ORDER BY delta in /public_html/mysite.co.uk/drupal/sites/all/modules/cck/content.module on line 979.

Refreshing the page gets rid of it.

loocher's picture
Offline
Joined: 02/21/2009
Juice: 211
Re: Unknown column 'delta' in 'order clause'

Then in the product node view:

warning: Invalid argument supplied for foreach() in /drupal/sites/all/modules/filefield/filefield_field.inc on line 127.
user warning: Unknown column 'delta' in 'field list' query: INSERT INTO content_field_image_cache (vid, nid, delta, field_image_cache_fid, field_image_cache_list, field_image_cache_data) VALUES (109, 109, 0, NULL, NULL, NULL) in /drupal/sites/all/modules/cck/content.module on line 1199.
user warning: Unknown column 'delta' in 'order clause' query: SELECT * FROM content_field_image_cache WHERE vid = 109 ORDER BY delta in /drupal/sites/all/modules/cck/content.module on line 979.
user warning: Unknown column 'node_data_field_image_cache.delta' in 'field list' query: SELECT node.nid AS nid, node.type AS node_type, node_data_field_image_cache.field_image_cache_fid AS node_data_field_image_cache_field_image_cache_fid, node_data_field_image_cache.field_image_cache_list AS node_data_field_image_cache_field_image_cache_list, node_data_field_image_cache.field_image_cache_data AS node_data_field_image_cache_field_image_cache_data, node_data_field_image_cache.nid AS node_data_field_image_cache_nid, node_data_field_image_cache.delta AS node_data_field_image_cache_delta, node.title AS node_title FROM node node LEFT JOIN content_field_image_cache node_data_field_image_cache ON node.vid = node_data_field_image_cache.vid WHERE (node.status <> 0) AND (node.type IN ('product','gallery','product_kit')) LIMIT 3, 30 in /drupal/sites/all/modules/views/includes/view.inc on line 731.

And various other errors over all site pages which I can't get rid of.

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: Re: Unknown column 'delta' in 'order clause'

It's possible, I guess, that the installation of the field_image_cache was messed up somehow. Try deleting it from all of your node types, and then click on the link to set up Ubercart default image support on the Store administration page.

Ben
Ben's picture
Offline
Joined: 08/29/2007
Juice: 38
Change the Global Settings "Number of Values"

I had the same problem. I solved it by changing the global settings "number of values" for the imagefield to "1" and then changing it back to "Unlimited." I'm not sure why that works, but the issue hasn't surfaced again since. Since these are global values, you only need to do it on one instance of imagefield.

Hope this helps.... before I solved this, it wasn't letting me save any images to a product node.

--Ben

MiriamNZ's picture
Offline
Joined: 12/10/2009
Juice: 2
Error persists in UC 6.x-2.0-rc7; solution above still works

I solved the problem same as Ben above (thank you for sharing here as well as on d.o, Ben).
I enabled attributes/classes after the online store was already set up (perhaps it is not a problem if attributes and classes are set up at the beginning).

I found references going back to 2008 of this problem on this site, but whatever it is, has not been fixed yet (or acknowledged as a problem in Ubercart).

It would be useful to add to the documentation for attributes/classes that image_field/image_cache can be expected to break when attributes or classes are first enabled and that changing the global settings for the imagefield can fix it. (I wonder if changing and saving any global setting would do it, or if it has to be the "number of values"?)

This comment describes how to replicate the problem in Ubercart 6.x-2.0-rc7 / D6.14 and suggests the reason for the problem:
http://drupal.org/node/383330#comment-2129526

wiifm69's picture
Offline
Joined: 01/17/2010
Juice: 15
Thanks Ben

Experienced this issue when I created a new product class, all of a sudden I got SQL errors:

Unknown column &#039;delta&#039; in &#039;where clause&#039; query: DELETE FROM content_field_image_cache WHERE delta &gt;= 1  in C:\xampp\htdocs\sites\all\modules\cck\includes\content.admin.inc  on line 1518.

Ben's solution fixed this right up. Is this a bug in Ubercart? Can a developer respond to this issue? Would be nice to not have to run this hack every time a new product class is added.

Thanks
Sean

Pixel8r-Dev's picture
Offline
Joined: 01/15/2010
Juice: 13
Ben wrote: I had the same
Ben wrote:

I had the same problem. I solved it by changing the global settings "number of values" for the imagefield to "1" and then changing it back to "Unlimited." I'm not sure why that works, but the issue hasn't surfaced again since. Since these are global values, you only need to do it on one instance of imagefield.

Hope this helps.... before I solved this, it wasn't letting me save any images to a product node.

--Ben

Perfect solution! Encountered same issue when added new product class. Thanks!

catamundo's picture
Offline
Joined: 01/08/2010
Juice: 2
Thanks for the fix!

Wow, thanks so much for this fix! What a relief.
I had the same problem, although it only appeared after installing iTweak Upload in hopes of improving the image interface; I'm guessing that created some adverse interaction in the database. In any case, Ben's fix worked perfectly, and iTweak and image_cache seem to be coexisting comfortably now.

A step-by-step guide on how to do this fix on new product classes, or if product images suddenly disappear:

Edit the content type that has missing images (e.g., from the administration menu: Content Management->Content Types->Edit Product).
Click on the 'Manage Fields' tab.
Click 'configure' next to the field that uses image_cache (by default, the field is labelled 'Image' and named 'field_image_cache'.
Under 'Global Settings', change the 'Number of Values' setting to 'Unlimited'.
Click the 'Save field settings' button; you'll be taken back to the 'Manage Fields' view.
Click 'configure' for the Image field again (field_image_cache), and return to Global Settings to change the Number of Values back to 1.

MathMan's picture
Offline
Joined: 06/10/2010
Juice: 17
Thank you very much ! Your

Thank you very much !
Your contribution saved me a lot of time !
Many thanks again to all of you ...

bsorrells's picture
Offline
Joined: 08/30/2010
Juice: 17
Same Problem

Just thought I would chime in that I had the same problem today with Drupal 6.19 and Ubercart 2.4.

I added a product class after I configured images for UC (by clicking on the link in the store admin overview screen). Images were not showing up -- but the image field was in the content type.

I tried a few solutions above like changing the number of images allowed and/or the delta -- but I eventually had to delete the image field from the product, product kit, and the new class I had created. Thank god I am in the beginning of setting up my store -- I only have a few images to put back in.

tourtools's picture
Offline
Joined: 11/18/2010
Juice: 11
Thank you Ben, your trick

Thank you Ben,
your trick works great:

I created a new product class from store interface and, after receiving a bounch of errors,
I went to the just created content type's field edit interface and modified the image field quantity, first to 1 then to illimitate.

It did work and the images for all the other products went at them places.

It would be nice if someone can take a deeper look in the code to see what happen.

bye

Bacteria Man's picture
Offline
Joined: 03/09/2010
Juice: 4
same problem, some solution

Kudos to Ben for posting his simple, but not so obvious solution.

The issue appears to be somewhat widespread and really should be considered a bug. The problem is: which module is responsible?

digitalsweetspot's picture
Offline
Joined: 08/19/2010
Juice: 6
Re: new product class > imageField dbase error

Kudos Ben! I was pulling out my hair trying to figure out why I lost all of my images. Luckily I back up my SQL before I make any *major* changes, so I reverted back to that and started retracing my steps. Once I saw that I broke after creating a new product class, I quickly googled this, found this thread, and saw the fix that worked for you. I tried it and BAM!...my images were back. You saved my butt, big guy!

Thanks again, Ben. Cheers!

BTW...I do agree with others that this should be considered a bug and should be resolved sometime in future updates (if there will be any).

CCW
CCW's picture
Offline
Joined: 11/20/2009
Juice: 12
So grateful to have come upon this thread!

Thank you Ben!