osCommerce / oscommerce2

osCommerce Online Merchant v2.x
http://www.oscommerce.com
MIT License
281 stars 222 forks source link

Gone admin order due to session recreation #616

Open Gergely opened 6 years ago

Gergely commented 6 years ago

Sometimes when admin left alone the order and press status change button some minutes later maybe lost order row (session expire issue - save zero into tables)

-- search query
SELECT o.*, osh.date_added FROM `orders` o left join orders_status_history osh on (osh.orders_id=o.orders_id) WHERE `orders_status` =0 and osh.orders_status_id =0;

-- discreet repair commands
update `orders` set orders_status=1 WHERE `orders_status` =0 limit 1;
update orders_status_history set orders_status_id=1 where orders_status_id =0 limit 1;

Probably strict save should be there when no posted zero values to prevent this

Gergely commented 6 years ago

Strict update_order only when not zero $status:

if ( (($check_status['orders_status'] != $status) || tep_not_null($comments)) && tep_not_null($status) ) {