Mage2Website: Code is too long

Hello,
after the configuration, we get a error:
Mage2Website: Code is too long (maximum is 32 characters)
can you please help us, to fix that?
magento 1: 1.8.1
magento 2: 2.1.8
 
best regards
frank

1 answer

Profile photo of Mall Staff 184060.00 $tone August 30, 2017
Public

Hi there,

Mage2Website: Code is too long (maximum is 32 characters)

That issue because your database has at least one website which has value of the code field is bad data with new rule of Magento2’s database in the table website.
To continue, you could do by options as followings:
Option 1: Manual re-update your website code in Magento1’s database to new value with length < 32 characters.
Option 2: Open the php file at path: pub/ub-tool/protected/controllers/Step2Controller.php
and find to the code line:

$website2 = Mage2Website::model()->find("code = '{$websiteCode2}'");

and replace it by code lines:

$websiteCode2 = ( strlen(trim($websiteCode2)) > 32 ) ? substr(trim($websiteCode2), 0, 32) : $websiteCode2;
$website2 = Mage2Website::model()->find("code = '{$websiteCode2}'");

Once done, you can continue with our tool.
Regards,
Mall.

#1

Please login or Register to Submit Answer

Written By

Comments