Unknown column 'p.sell_price'

Project:Ubercart Contributions
Component:Code
Category:
Priority:normal
Assigned:Lyle
Status:fixed
Description
Project: 
Ubercart

When sorting a product list view on "price", this error is shown:

user warning: Unknown column 'p.sell_price' in 'order clause' query: SELECT DISTINCT(n.nid), n.sticky, n.title, n.created FROM node n INNER JOIN term_node tn ON n.nid = tn.nid WHERE tn.tid = 8 AND n.status = 1 AND n.type IN ("product") ORDER BY p.sell_price ASC LIMIT 0, 10 in directory\includes\database.mysql.inc on line 172.

Sorting on "name" is no problem.

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: Unknown column 'p.sell_price'

I should add some kind of "Version" information to issues. I'll get very confused otherwise.

I'm sure this affects alpha 7b, but it has been fixed in the bazaar. Hang tight until the next release.

qrios's picture
Offline
Cool profile pic award.Getting busy with the Ubercode.Internationalizationizer
Joined: 08/13/2007
Juice: 554
Thanks for info. Could you
Assigned to:Lyle» qrios

Thanks for info.

Could you point me to the faulty code, and probably the fix? I need it now for I have to go live with a project...

Thanks in advance.

Kees

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: Thanks for info. Could you
Assigned to:qrios» Lyle

I think I've isolated the changes that you need since the 7b release. I've attached a patch that will change the SQL queries in the catalog and product modules. Let me know if there's any problems with it.

AttachmentSize
product_order.txt 2.17 KB
qrios's picture
Offline
Cool profile pic award.Getting busy with the Ubercode.Internationalizationizer
Joined: 08/13/2007
Juice: 554
Re: Re: Thanks for info. Could you
Assigned to:Lyle» qrios

No probs, works like a charm, thanks again!

moog's picture
Offline
Joined: 08/08/2007
Juice: 46
Re: Re: Re: Thanks for info. Could you
Assigned to:qrios» moog

Thank you. Worked perfectly Smiling

baalsgate's picture
Offline
Joined: 09/12/2007
Juice: 46
same problem
Assigned to:moog» baalsgate

I tried the patch as well and yes fixes the error but listing by price the price colum is one colour rather than alternative colours in line with the product row background , is this related to this fix ?

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: same problem
Assigned to:baalsgate» Ryan

I believe what you're referring to is the default Drupal behavior for sorted tables. It automatically highlights the column of the table that is being sorted on. You can probably override this in your theme if you don't want that to happen.

baalsgate's picture
Offline
Joined: 09/12/2007
Juice: 46
theme
Assigned to:Ryan» baalsgate

oh ok thanks Smiling