Inconsistency in "order status" data type

Posts: 3
Joined: 10/07/2007
Bug Finder

Hello..

I've installed Ubercart version alpha-7e and I have a problem when I change an order status. If I change the status, all statuses will appear on the list. If I change the status again, the list is doubled. I traced the code and I think I found something strange.

<?php
// uc_order.module line 2625
$join = " LEFT JOIN {uc_order_statuses} AS os ON oc.order_status = os.order_status_id";
?>

That is the SQL code for joining uc_order_comments table and uc_order_statusses table based on oc.order_status = os.order_status_id criteria. If I look to the table CREATE statement, the type of oc.order_status is tinyint(4) and os.order_status_id is varchar(32). So we can see those two data types are different.

I think that's why if I change the status, all statuses suddenly appear on the list.

Posts: 3
Joined: 10/07/2007
Bug Finder

humm.. I hope this problem will be solved by only changing the data type of oc.order_status to varchar(32)

Posts: 5367
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Definitely. Many thanks, iang. Smiling I'll make changes where appropriate. I thought I ran into this problem myself, but I couldn't reproduce the problem so I figured it was a fluke.

Enjoy your shiny new user badge. Eye-wink

Posts: 3
Joined: 10/07/2007
Bug Finder

Thanks Smiling

Maybe you should also fix the CREATE statements inside uc_order.install for the next releases. So nobody will face the same problem again Smiling

Posts: 5367
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Done deal... I had it right in an update function which is why I wasn't able to reproduce it on my test sites. Fixed the CREATE and am hoping people will find this thread between now and the next release. Eye-wink