Error Migrate Sales step 7

Hi there:
In step 7 show this errror
http://vvcap.com/lvCmghY6rkn

[error] [ub_data_migration] CDbCommand failed to execute the SQL statement: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: ‘0000-00-00 00:00:00’ for column ‘expiration_date’ at row 1. The SQL statement executed was: INSERT INTO `salesrule_coupon` (`times_used`, `type`, `rule_id`, `code`, `usage_per_customer`, `expiration_date`, `is_primary`, `created_at`) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5, :yp6, :yp7)
 
I have registers null in this field. Can this be the mistake?
 
http://vvcap.com/5vOdNUMhkFf
 
Thanks regards.

5 answers

Profile photo of Mall Staff 184060.00 $tone July 19, 2017
Public

Hi there,

I have registers null in this field. Can this be the mistake?

Yes, let’s do it and you can continue with data migration. And tell me know how it goes.
Regards,
Mall.

#1
Profile photo of Mall Staff 184060.00 $tone July 19, 2017
Public

Hi there,

the problem was a register 0000-00-00 00:00:00 in ‘expiration_date’

So, let’s do steps as bellow:
-- Open the php file at pub/ub-tool/protected/controllers/Step7Controller.php
and find to the code line:

$coupon2->rule_id = $salesRule2->rule_id;

and replace it by code lines:

$coupon2->rule_id = $salesRule2->rule_id;
if (empty($coupon2->expiration_date) || $coupon2->expiration_date === '0000-00-00 00:00:00') {
$coupon2->expiration_date = date("Y-m-d H:i:s");
}

Once done, you can continue with data migration in the step #7.
Regards,
Mall.

#3

Please login or Register to Submit Answer

Written By

Comments