Ship Manually Ends With Error - Cannot Ship Manually

Project:Order Updates
Component:Code
Category:
Priority:critical
Assigned:Unassigned
Status:active
Description
Project: 
Ubercart

When saving a shipment with the "Ship Manually" method, the shipment is not saved, and the following error message is given:

user warning: Field 'o_first_name' doesn't have a default value query: INSERT INTO uc_shipments (sid, order_id) VALUES (5, 10) in C:\Zend\Apache2\htdocs\drupal\includes\database.mysql.inc on line 174.

The source of the problem seems to be in uc_shipping.module on line number 1269, where it executes the following code:

db_query("INSERT INTO {uc_shipments} (sid, order_id) VALUES (%d, %d)", $shipment->sid, $shipment->order_id);

All of the columns for the table UC_SHIPMENTS are NOT NULL, and only one column has a default value.

Basically, the problem seems to either be that this insert statement is not saving enough of the shipment information, or the CREATE TABLE statement (MySQL version) in uc_shipping.install needs to be altered to give default values to the columns.

The PostgreSQL version of the table creation seems to have all of the columns with the correct default values.

UPDATE
==============
Project changed to Ubercart.

Version: 
Ubercart 1.7
Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Ship Manually Ends With Error - Cannot Ship Manually

This looks like a bug report for Ubercart itself. If so, please post it as an issue in the issue tracker.

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: Re: Ship Manually Ends With Error - Cannot Ship Manually
Assigned to:Ryan» Lyle

Well, I haven't seen an issue in the tracker, so I'll just post the patch here.

AttachmentSize
default_shipping.patch 9.07 KB
kurzweil4's picture
Offline
Joined: 02/14/2009
Juice: 19
Lyle,Thanks for the quick
Assigned to:Lyle» kurzweil4

Lyle,

Thanks for the quick solution. I am running on Windows, how do I apply this patch and cause uc_shipping_update_3() to execute?

Any order I tried to ship manually is now stuck in a state of needing to be shipped, but the system will not allow me to create shipments for them. Is there just a flag I need to reset on a table, or would it be easier to delete and re-key the orders?

I misunderstood what Ryan was trying to explain to me about where to post this problem. I thought that this was the main place to track issues. I have posted this problem in the Ubercart tracker on Drupal. I will be sure to post any bugs there should I find any in the future.

Thanks,
Kurzweil4

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: Lyle,Thanks for the quick
Assigned to:kurzweil4» Lyle

You'll probably have to delete the shipments and recreate them. If that doesn't work, try deleting the packages, too. If nothing else, you can delete the rows in the uc_shipments, uc_packages, and uc_packaged_products tables for those orders.

For Windows, unless you've already got something set up to apply patches, the quickest thing is to add and remove the lines manually. Open up the files listed in the patch and remove the lines starting with - and add the lines starting with +. Once that's done, save the files and browse to update.php on your site.