Error – Mage2ReviewDetail: Detail cannot be blank

I am getting an error message in step 8 on Data Migration Pro.
 
Message: Mage2ReviewDetail: Detail cannot be blank.
 
I tried to fix to follow your direction but still getting same error. Please advise about it .Thank you.
 
+ Step 1: Open the php file at path: pub/ub-tool/protected/controllers/Step8Controller.php
and find to the code line:

if (!$reviewDetail2->save()) {

and replace it by code lines:

if (empty($reviewDetail2->detail)) {
$reviewDetail2->detail = 'N/A';
}
if (!$reviewDetail2->save()) {

 

18 answers

Profile photo of Mall Staff 184060.00 $tone August 8, 2018
Public

Hi there,

Message: Mage2ReviewDetail: Detail cannot be blank.

That issue because your database has bad data in the product review data section. If the issue still persists after you have applied the tweak code. Let’s provide me information about your instance:
+ Admin credentials and URL to back-end
+ SSH credentials and path to M2 folder
I will help to check further and help you out.
Regards,
Mall.

#1
Profile photo of Mall Staff 184060.00 $tone August 8, 2018
Public

Hi there,
I checked in your instance and I see another issue with bad data: http://i.prntscr.com/CrYMPJ5PRnmaMSgzqSY-yA.png

Status: fail
Message: Mage2ReviewDetail: Nickname cannot be blank

To solve that issue, let do more steps below:
+ Open the php file at path: pub/ub-tool/protected/controllers/Step8Controller.php
and find to the code lines:

if (empty($reviewDetail2->detail)) {
$reviewDetail2->detail = 'N/A';
}

and replace it by code lines:

if (empty($reviewDetail2->detail)) {
$reviewDetail2->detail = 'N/A';
}
if (empty($reviewDetail2->nickname))
{
$reviewDetail2->nickname = 'N/A';
}

+ Once done, you could continue with data migration in the step #8 of our migration tool.
Regards,
Mall.

#3
Profile photo of unidatnj 150.00 $tone August 8, 2018
Public

After replace, I got a different error,
CDbCommand failed to execute the SQL statement: SQLSTATE[HY093]: Invalid parameter number: no parameters were bound. The SQL statement executed was: SELECT * FROM `mg_rating` `t` WHERE rating_code = ‘What’s your overall rating?’ LIMIT 1

#4
Profile photo of Mall Staff 184060.00 $tone August 8, 2018
Public

Hi there,

The SQL statement executed was: SELECT * FROM `mg_rating` `t` WHERE rating_code = ‘What’s your overall rating?’ LIMIT 1

That because your database has special chars in the value of the rating_code. To handle for that issue, let’s do steps below:
+ Open the php file at path: pub/ub-tool/protected/controllers/Step8Controller.php
and find to the code line:

$model2 = Mage2Rating::model()->find("rating_code = '{$model->rating_code}'");

and replace it by code line:

$model2 = Mage2Rating::model()->find("rating_code = '" . addslashes($model->rating_code) . "'");

+ Once done, you could continue with data migration in the step #8 of our migration tool.
Regards,
Mall.

#5
Profile photo of ubdev Staff 98150.00 $tone August 9, 2018
Public

Hi there, 
Glad that it helps. 
If you have any additional question, please submit a new ticket or get back to us here, we will help you out. 
Regards,
Ubertheme team

#7
Profile photo of unidatnj 150.00 $tone August 9, 2018
Public

Hi,
I got an error on step 7 -- Migrate Sales.
“Mage2SalesOrder: Created At cannot be blank.”
I changed step7controller.php but still same error.
 
if ($salesOrder2->update()) { 
 
=====> 

if ($salesOrder2->updated_at === ‘0000-00-00 00:00:00’ || empty($salesOrder2->updated_at)) {
$salesOrder2->updated_at = date(“Y-m-d H:i:s”);
}
if ($salesOrder2->update()) {
 
 

#8
Profile photo of Mall Staff 184060.00 $tone August 9, 2018
Public

Hi there,

“Mage2SalesOrder: Created At cannot be blank.”

That is a similar issue with bad data in the sales data section but it happens on another attribute (created_at). To handle for that case, you could do more steps below:
+ Open the php file at path: pub/ub-tool/protected/controllers/Step7Controller.php
and find to the code line:

if ($salesOrder2->update()) {

and replace it by code lines:

if ($salesOrder2->created_at === '0000-00-00 00:00:00' || empty($salesOrder2->created_at)) {
     $salesOrder2->created_at = date("Y-m-d H:i:s");
}
if ($salesOrder2->update()) {

+ Once done, you could continue with data migration in the step #7 of our migration tool.
Regards,
Mall.

#9
Profile photo of unidatnj 150.00 $tone August 9, 2018
Public

Hi,
I replaced the code but still same error occur. 
if ($salesOrder2->created_at === ‘0000-00-00 00:00:00’ || empty($salesOrder2->created_at)) {
$salesOrder2->created_at = date(“Y-m-d H:i:s”);
}
if ($salesOrder2->update()) {
 
“Mage2SalesOrder: Created At cannot be blank.”

#10
Profile photo of Mall Staff 184060.00 $tone August 9, 2018
Public

Hi there,

“Mage2SalesOrder: Created At cannot be blank.”

Lets try do more steps below:
+ Open the php file at path: pub/ub-tool/protected/controllers/Step7Controller.php
and find to the code line:

if (!$salesOrder2->save()) {

and replace it by code lines:

if ($salesOrder2->created_at === '0000-00-00 00:00:00' || empty($salesOrder2->created_at)) {
$salesOrder2->created_at = date("Y-m-d H:i:s");
}
if (!$salesOrder2->save()) {

And tell me know how it goes then.
Regards,
Mall.
 

#11
Profile photo of Mall Staff 184060.00 $tone August 10, 2018
Public

Hi there,

All categories and products are not shown. Please take a look my admin page and advice me how to resolve this problem.

I have checked in back-end of your site and I saw that, the default website is ‘Missha US Inc’ and the default Store on default website is ‘WWW.MISSHAUS.COM’ and the root category of this default store is ‘All’. And the root category named ‘All’ is not migrated root category, this is root of the issue you mentioned. 
You could see this: https://prnt.sc/kgv3sb
Let’s change the root category of the default store in default website to a migrated root category. And then, reindex the data and clean the Magento cache. And tell me know how it goes.
Regards,
Mall.
 

#15
Profile photo of Mall Staff 184060.00 $tone August 10, 2018
Public

Hi there,

I have changed the root category and reindex the data and clean the cache.  But same issue. Products are not displayed in category page.

I think the issue related to the third-party extensions and theme which you are using in your M2 instance. I tried to search an enabled product (SKU = MSMS5090AA):  

Actually, all issues relate to the third-party extensions and theme are beyond of our scope of support.
We did recommend the best practice to proceed migration on a fresh instance. You can refer to our Readme.html included in your download package for this. 
I know it takes you extra time, however could you disable all your third-party extensions and theme to migrate the migrated data first?

Regards,
Mall.

#17
Profile photo of Mall Staff 184060.00 $tone August 10, 2018
Public

Hi there,
I helped to check further in your instance and see the issue as below after enabling developer mode in your M2 instance:

1 exception(s): Exception #0 (Exception): Item (Magento\Review\Model\Review\Summary) with the same ID “5849” already exists.

It seems that issue occurs as you did re-migrate many times in the step #8 when you tried to fix the bad data cases on review data section in the first time.
While checking, I also just noticed that you have removed the Review data section, which is not recommended. This will affect the delta migration phase later on (if you do). 
So, under this circumstance, you should Reset step 8 and re-migrate again to ensure data integrity. 

Regards,
Mall.

#18

Please login or Register to Submit Answer

Written By

Comments