WP-e-Commerce icon indicating copy to clipboard operation
WP-e-Commerce copied to clipboard

updating purcahse log check if value exists

Open mihaijoldis opened this issue 7 years ago • 0 comments

An example:

$order = new WPSC_Purchase_Log( $log_id );
$order->set( 'my_custom_data', '1' )->save();

throws a notice since my_custom_data is not a field in the purchase log table but the value does get saved as a meta field. save() would normally do that on it’s own, but it supposes that you’re updating something on the purchase table as well. Seems to me that somewhere in here, we should be validating the $data. If it’s empty, we’ve got nothing to update, and should bail.

https://github.com/wp-e-commerce/WP-e-Commerce/blob/4ea716c80c874833bd909ca7c56581b654807b35/wpsc-includes/purchase-log.class.php#L1005-L1008

mihaijoldis avatar Jan 17 '18 18:01 mihaijoldis