I am getting the following error on node, Views: page.
It occurred after making changes to Ubercart class and attribute settings. I have not amended the database or template files at all.
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','product_kit')) LIMIT 3, 30 in /home/mysite/drupal/sites/all/modules/views/includes/view.inc on line 731.
Multiple rows of this error on Ubercart catalog views:
user warning: Unknown column 'delta' in 'order clause' query: SELECT * FROM content_field_image_cache WHERE vid = 103 ORDER BY delta in /home/mtsite/drupal/sites/all/modules/cck/content.module on line 979.
Comment | File | Size | Author |
---|---|---|---|
#62 | 383330-keep-imagefield-settings.patch | 1.39 KB | longwave |
#25 | 383330_global_field_settings.patch | 927 bytes | Island Usurper |
#22 | 383330_global_field_settings.patch | 1.19 KB | Island Usurper |
Comments
Comment #1
La M CreditAttribution: La M commentedComment #2
NikLP CreditAttribution: NikLP commentedDid you run update.php, or even check that this version of the module would alter your database?
Comment #3
La M CreditAttribution: La M commentedHi
Yes I ran an update. I didn't check about the database because it was a recommended install as part of ubercart, image.cache.
thanks
Comment #4
ismaiel CreditAttribution: ismaiel commentedsame problem
Comment #5
suersan CreditAttribution: suersan commentedsame here too,
even for additional image field does not fix the problem,
I delete the imagecache module along with the database part, then installed again, still same problem. Need help...
there are some suggestions over here, it did not work for me , maybe you are a lucky one.
http://www.ubercart.org/forum/bug_reports/3489/cart_error_message_after_...
Comment #6
InternetDevels CreditAttribution: InternetDevels commentedsubs
Comment #7
InternetDevels CreditAttribution: InternetDevels commentedI opened database and found that the table have not column 'delta', so I added it to table and resolved the problem.
Comment #8
drewish CreditAttribution: drewish commentedthis is totally not an imagecache issue. imagecache doesn't provide fields.
Comment #9
Island Usurper CreditAttribution: Island Usurper commentedWhat version of Ubercart are you on? There have been some problems lately with Imagefield changing it's field settings so that Ubercart 2.x-beta5 doesn't provide the right values when it creates the default image field.
Comment #10
asak CreditAttribution: asak commentedI'm getting this error after trying to upload an image to a product:
user warning: Unknown column 'delta' in 'order clause' query: SELECT * FROM content_field_image_cache WHERE vid = 3 ORDER BY delta in /home/..../public_html/gold/sites/all/modules/cck/content.module on line 987
Modules:
D6.10
Ubercart 6.x-2.0-beta6
Imagefield 6.x-3.0-rc1
Filefield 6.x-3.0-rc1
Imagecache 6.x-2.0-beta8
Comment #11
asak CreditAttribution: asak commentedAnd this one:
# 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 (3, 3, 0, 13, 1, 'a:2:{s:3:\"alt\";s:21:\"חנות\";s:5:\"title\";s:21:\"חנות\";}') in /home/.../public_html/gold/sites/all/modules/cck/content.module on line 1207.
Comment #12
Island Usurper CreditAttribution: Island Usurper commentedUnder the Manage fields page, do the settings for field_image_cache say you can have multiple values? It looks like CCK expects it to, though the database table wasn't created that way for some reason.
Comment #13
NikLP CreditAttribution: NikLP commentedSome of that sounds like someone has jumped versions or not run their update.php properly...
Comment #14
asak CreditAttribution: asak commentedThank you guys... i outta be spanked ;)
Comment #15
Island Usurper CreditAttribution: Island Usurper commentedDoes that mean nothing needs to be done here? If there's a solution, post it and mark this as "fixed".
Comment #16
BenK CreditAttribution: BenK commentedI had the same problem. I solved it by changing the global settings "number of values" for the imagefield to "1", saving the node, 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 (field_image_cache).
Hope this helps.... before I solved this, it wasn't letting me save any images to a product node.
--Ben
Comment #17
Island Usurper CreditAttribution: Island Usurper commentedComment #19
dan3h CreditAttribution: dan3h commentedI also had the same problem. The solution posted in comment #16 worked like a charm for me. Thanks, BenK!
Comment #20
John Carbone CreditAttribution: John Carbone commentedHuh... ran into a very similar message when working with noderef: "user warning: Unknown column 'delta' in 'order clause' query: SELECT * FROM content_field" ... yada yada... totally unrelated to UC, but comment 16 fixed it for me too. Thanks! Just to clarify for anyone else that might find this, I think he meant to say to change the settings on the content type and save it, not the node. : )
Comment #21
ericduran CreditAttribution: ericduran commentedHey,
Sorry for setting this issue back to active. But the problem is in the way Ubercart set up new classes.
So here's my set-up
-Ubercart 6.x-2.0-rc7
-Drupal 6.14
-....(All Latest modules)
Here's how you can duplicate the error.
1. Go into the default product content type - and modified the image field and set the Number of Values to be 1.
2. Create product nodes with images on then.
3. Create a new product class in ubercart.
4. Now the nodes you created should loose their images.
That should be all that's require to duplicate the error.
So here's what I go so far
When the new product class is created the uc_product_class_form_submit function is call which calls the uc_product_add_default_image_field function.
In the uc_product_add_default_image_field function a new instance of an image_field is attached. You can see the code below.
The checking is just there to avoid overwritten the settings when updating a class.
The real problem is when the field array is being created
As you can see above the global settings such as required, multiple, list_field, list_default, and description field are set in the new instance array. Which in turns are applied when then content_field_instance_create function is call with the $field parameter.
So what happens is that every time a new class is created the global settings are reapply and the field table gets re-setup. Which cause you to loose that data. Which sucks. :-(
So there's the problem.
A quick-fix is just commenting the global settings. I know this works once you have the "product" node set up. But I don't know what the consequence will be if it's a clean install and the uc_product_enable function is call.
Comment #22
Island Usurper CreditAttribution: Island Usurper commentedIt seems there's quite a lot in that field definition that we don't need. Here's a patch to take it out. I haven't tested the case where it creates a brand new image field, but I'll get to that next.
Comment #23
Island Usurper CreditAttribution: Island Usurper commentedDang. It looks like it wants to list the files through CCK when the field is added afresh. That's not good for the initial field settings, but I can imagine some reasons why someone would change that for their product images.
Comment #24
ericduran CreditAttribution: ericduran commentedYou can just put an if for the 1st time the field is getting creating and add the list_field then just leave it out after. I'll submit a patch tomorrow.
Comment #25
Island Usurper CreditAttribution: Island Usurper commentedActually, since display_settings are per-instance settings, I can leave them in the $field. Give this patch a test install. I've been using drush to disable/enable the modules quickly. Make sure you actually remove the field first, if you do that.
Comment #26
Bilmar CreditAttribution: Bilmar commentedsubscribing
Comment #27
josi123 CreditAttribution: josi123 commentedSome problem. #16 fixed. The bug is there in latest version of ubercart. Also image field is created with no label and 'files' as default path.
Comment #28
jrefano CreditAttribution: jrefano commentedsame issue, #16 fixes for me as well
Comment #29
weblance CreditAttribution: weblance commentedthanks ben. #16 did not work for me at first but when I stood on one leg and barked like a cat it worked like charm.
Comment #30
p4trizio CreditAttribution: p4trizio commentedHi Jeff, I was very skeptic about #16 but I gave it a try and it amazingly worked.
Believe in it!!! :D
PS. I'm using the latest versions (Drupal 6.15, Ubercart 2.2, cck 2.6, imagecache 2.0-beta10)
Comment #31
weblance CreditAttribution: weblance commentedNo it worked for me too. I just think it is funny and reminds me of when the Fonz hits the jukebox or in the 60's when hitting the TV got the picture to stop fluttering. Just making light of the fix. It is actually an amazing find. I don't know how people figure that stuff out. Didn't mean to sound cynical.
Comment #32
p4trizio CreditAttribution: p4trizio commentedActually I found it funny too, anyway Ben was a genius ;-)
Comment #33
dbeall CreditAttribution: dbeall commented#16,, works for me, I would never have tried that, thanks
Comment #34
noslokire CreditAttribution: noslokire commentedBoo to this bug, #16 worked for me as well!
Comment #35
freelockI suspect this is really a CCK issue, related to sharing a field across multiple content types. A few weeks ago we tracked down this bug: #671708: Repeating date should be a different date type by stepping through the debugger, and basically found that CCK would alter the underlying table in the database whenever you saved the field definition on a content type. So whichever content type you looked at last could actually delete data in the same field, in other content types!
I'm not sure this is the problem here, but I really suspect it's the same bug. In our case, we started getting this error (and images disappeared) when we enabled the Product Kit module. Suddenly the field_image_cache was no longer unlimited in all content types it appeared in, and the image queries broke with this error. That would explain why changing the number of instances (twice) would repair it -- though you would lose any additional images.
Can anybody confirm?
Comment #36
markagray CreditAttribution: markagray commentedI'd like to try #16 but I'm not certain that I am doing it correctly. We have lost all of the images that we had attached to our products and our product kits. I tried this
1. Go to Home → Administer Site → Content management → Product
2. Pull down "Image Attach Settings"
3. Changed "Maximum Number of Images" from Unlimited to 1.
4. Save content type.
5. Repeat steps 1 through 4, changing 1 to Unlimited.
6. Repeat steps 1 through 5 for two product classes we created.
7. Repeat steps 1 through 6 for Product Kits.
These changes had no effect so I tried:
8. Go to Home → Administer Site → Site building → ImageCache
9. Flushed all listed image caches.
This had no effect so I tried:
10. Go to Home → Administer Site → Site configuration → Performance
11. Clicked on "Clear cached data".
This had no effect.
Were steps 1 through 5 the correct steps for the #16 fix?
Comment #37
markagray CreditAttribution: markagray commentedUpdate to #36.
1. Go to Home → Administer Site → Content management → Product
2. Clicked on the Configure link for field_image_cache.
3. Performed the workaround described in #16.
It worked!
Thanks BenK!
Comment #38
TR CreditAttribution: TR commentedSo is anyone going to try out the patch in #25 and report on it? The "workaround" in #16 isn't a fix to Ubercart, doesn't get this issue any closer to being resolved, and doesn't keep other people from encountering the same problem.
If you are one of the people experiencing this problem, the community needs to test the patch and let us know whether that fixes things. Only when the patch has been show to work without causing other problems will it be committed to Ubercart.
Comment #39
victoria_b CreditAttribution: victoria_b commented#16 worked for me too. What a life saver!
Nice work Ben.
Victoria
Comment #40
markagray CreditAttribution: markagray commentedTR,
I'll try the patch. To test it, what would I do before and after applying the patch? For example, would I remove the images from the products, apply the patch, then add the images back to the products?
Comment #41
robby.smith CreditAttribution: robby.smith commentedsubscribing
Comment #42
AlexisWilke CreditAttribution: AlexisWilke commentedThis is a problem with the fact that at this time the Product Kit does not have an image fieldset like the standard product has.
Somehow, I have not seen those errors in my logs or on screen but it is a problem for me since I show a list of software for sale and all the bundles do not include the field.
I did not read all the comments, but patches in #22 and #25 have nothing to do with improving the software. It just removes the SQL error. We'd need to add the field to the product kit table and the code in the node edit page so we can have an image. 8-)
Maybe I'll do that later, although right now I have a few other problems to work on...
Comment #43
dmurray CreditAttribution: dmurray commentedI had the same issue as documented here, #16 fixed the errors but did result in all the images being lost :(
Comment #44
scotwith1tDefinitely causing some folks some issues...glad for #16's work-around though!! Whewww!
Comment #45
cha0s CreditAttribution: cha0s commentedThe workaround from a year ago helped me as well! Sometimes I just can't keep up with this fast-moving open source stuff...
Comment #46
csc4 CreditAttribution: csc4 commentedI've just hit this problem with a clean install - and part of the issue seemed to be that the Product image had files as the directory which was throwing an error so I had to change that as well as performing the changes in #16
Comment #47
colorado CreditAttribution: colorado commentedThank you for posting this fix! This worked for me as well.
Comment #48
dejavu007 CreditAttribution: dejavu007 commentedPost #16 Hack fixed it...... Thanks
Comment #49
perusio CreditAttribution: perusio commentedHmm. For me the solution was much simpler than the one outlined in #16 and #36. I created additional product classes and somehow the field became multivalued instead of a single value field. I went into the "master" product content type and set it to single value. Voilá: problem solved!
Comment #50
shotokai CreditAttribution: shotokai commentedI had the same problem, and I did run update.php (over and over). The issue however was update.php related.
The version update on the uc_product module was not being picked up correctly, so I had to set it manually. That fixed the issue for me.
Comment #51
Jimmel CreditAttribution: Jimmel commented#49 works fine for me with the ubercart creating classes problem.
Comment #52
leovw CreditAttribution: leovw commentedHi Just wanted to say thanks and let people know that applying the patch in #22 let me create new classes without losing my images!
Comment #53
rgsBenK rocks. Will have to try the patch.
Comment #54
isimo CreditAttribution: isimo commentedI had this problem and none of the fixes worked. I wanted to stipulate 1 image rather than multiple. I realised i had a relationship on the image fid on the 'views - > relationships' which i don't suppose is needed on a single image value. I deleted this and it has started to work.
Comment #55
TR CreditAttribution: TR commentedComment #56
TR CreditAttribution: TR commentedUntagging and changing status.
Comment #57
extensive CreditAttribution: extensive commentedMake image_cache amount from 1 to unlimited the error has gone for me!
Comment #58
TR CreditAttribution: TR commentedMoving to "Product kit" component.
Comment #59
longwaveAgreeing with freelock in #35 - I suspect this is an obscure bug in CCK that only occurs when sharing fields between content types, and when those fields are created programmatically rather than in the UI. I have seen similar issues in Features and there are a couple of bug reports in Date about the same thing. Tracking down the offending piece of code seems very difficult, though.
Comment #60
longwaveFrom #1830752: Creating New Product Class Makes Images in Existing Products Vanish, if ImageField is not set to Unlimited
Comment #61
adijeff CreditAttribution: adijeff commentedA year later, #49 worked for me. Thanks perusio.
Comment #62
longwaveFinally, thanks to the steps listed in #60, I think I have a patch that solves this. This ensures that if a field instance already exists, we copy the settings from the existing field, rather than always trying to reset it to "unlimited".
Comment #63
longwaveCommitted. After applying the patch in #62, the steps in #60 no longer produce an error, and the newly added product class has an image field set to 1 image rather than unlimited.
Comment #65
Jenechka CreditAttribution: Jenechka commentedThank you Eric!