1. Create an order
2. Add a line item, with amount "f"
3. Save order

Results in

Error message
Amount must be a number.
PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect decimal value: 'f' for column 'amount' at row 1: UPDATE {uc_order_line_items} SET title=:db_update_placeholder_0, amount=:db_update_placeholder_1 WHERE (line_item_id = :db_condition_placeholder_0) ; Array ( [:db_update_placeholder_0] => Empty line [:db_update_placeholder_1] => f [:db_condition_placeholder_0] => 1 ) in uc_order_update_line_item() (line 77 of /vagrant/www/drupal7/sites/d7.localhost/modules/ubercart/uc_order/uc_order.line_item.inc).
The website encountered an unexpected error. Please try again later.

What's interesting is that the validation error appears, but it doesn't stop the form submit process.

Members fund testing for the Drupal project. Drupal Association Learn more


djdevin created an issue. See original summary.

djdevin’s picture

Status: Active » Needs review
832 bytes

It's strange that the line item submit handler is running in order panes "edit-process" operation, even though that means validation could have failed and it will still run anyway.

Maybe not the best solution, but I added a check to form_get_errors() and now it works as expected.