2

Urgent help needed!

After migrating data from M1 to M2 (Magento v2.2.5) using UB Data Migration Pro, when I click edit to any Customer at the Magento 2 Admin Panel, I get these error messages:

Fatal error: Uncaught TypeError: Argument 1 passed to Magento\Eav\Model\Entity\Attribute\Source\Config::__construct() must be of the type array, null given, called in /home/91647.cloudwaysapps.com/fvrpgyvmqm/public_html/aandhcom/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 111 and defined in /home/91647.cloudwaysapps.com/fvrpgyvmqm/public_html/aandhcom/vendor/magento/module-eav/Model/Entity/Attribute/Source/Config.php on line 26

TypeError: Argument 1 passed to Magento\Eav\Model\Entity\Attribute\Source\Config::__construct() must be of the type array, null given, called in /home/91647.cloudwaysapps.com/fvrpgyvmqm/public_html/aandhcom/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 111 in /home/91647.cloudwaysapps.com/fvrpgyvmqm/public_html/aandhcom/vendor/magento/module-eav/Model/Entity/Attribute/Source/Config.php on line 26

I have tried running below commands:

rm -rf var/page_cache/* var/cache/* generated/code/* var/log/* var/report/* generated/metadata/* var/view_preprocessed/* pub/static/*
php -d memory_limit=-1 bin/magento setup:upgrade
php -d memory_limit=-1 bin/magento setup:db-schema:upgrade
php -d memory_limit=-1 bin/magento setup:di:compile
php -d memory_limit=-1 bin/magento setup:static-content:deploy -f
php -d memory_limit=-1 bin/magento cache:clean
php -d memory_limit=-1 bin/magento cache:flush
php -d memory_limit=-1 bin/magento indexer:reindex
php -d memory_limit=-1 bin/magento cache:clean
php -d memory_limit=-1 bin/magento cache:flush

All commands executed successfully, but still, the error exists. Have a look at the screenshots below:

enter image description here

enter image description here

  • 1
    Couldn't see the full stack trace from the image. – Khoa TruongDinh Nov 8 '18 at 8:06
  • @KhoaTruongDinh You mean to say that I should paste a screenshot till the end? – Fayyaz Khattak Nov 8 '18 at 8:33
  • @KhoaTruongDinh, Please post your answer to this issue magento.stackexchange.com/questions/249369/… – jafar pinjar Nov 8 '18 at 9:36
  • 1
    may be version issue i did data import with UB with magento 2.1.8 whitout any problem. – Qaisar Satti Nov 9 '18 at 11:12
  • @QaisarSatti Upgraded to latest version, still to no avail! – Fayyaz Khattak Nov 9 '18 at 12:30
1

when I click edit to any Customer at the Magento 2 Admin Panel, I get these error messages:

It seems it associates with the custom customer attributes.

For the custom Attributes, our UB Data Migration Pro is ready to migrate to your Magento 2, however there might be unexpected issues depending on your specific custom attributes. For instance, the attribute added manually by you or via 3rd extension that has a custom backend_model class (not using Magento core class), then we will need an extra step after migration to manually update this custom backend_model class.

Please note such custom attributes will require that your M2 extensions must be ready, otherwise those attributes will be of no use.

Since we provide a dedicated technical support helpdesk, please submit a ticket there and provide us the following credentials (make sure you submit a private ticket):

  • Admin credentials and URL of your M2 instance
  • SSH credentials of your M2 instance
  • Let us know the path of your M2 directory

We will help to check further which custom attribute caused the issue, and suggest you workaround accordingly then.

PS1. All technical support related to our products are provided via the helpdesk mentioned above only, so please follow up further with us there.

PS2. We do have an old migration script on Github which we no longer maintain. We wonder which migration tool you're using.

Sincerely, Ubertheme team

  • Thanks for the wonderful explanation. I'll surely submit a ticket. – Fayyaz Khattak Nov 9 '18 at 15:55
  • Question asked! Please have a look, thanks. – Fayyaz Khattak Nov 9 '18 at 17:44
3

Please re-check your code. Try to find classes constructor with \Eav\Model\Entity\Attribute\Source\ConfigFactory

in code you have line like this $this->configFactory->create(); but should be $this->configFactory->create($optionsData); You should pass parameter into factory create function.

I hope it will help you to solve this issue.

  • But as you know, editing core is not a good practice. Is there any workaround? – Fayyaz Khattak Nov 8 '18 at 8:32
  • At vendor/magento/module-eav/Model/Entity/Attribute/Source/Config.php, I have this code in the constructor: public function __construct(array $options) { $this->_optionsData = $options; } – Fayyaz Khattak Nov 8 '18 at 8:44
  • @FayyazKhattak, Please update me your answer for this issue, magento.stackexchange.com/questions/249369/… – jafar pinjar Nov 8 '18 at 9:30
1

In my case we forgot to define source for new attribute of the customer: Instead of: php $eavSetup->addAttribute(Customer::ENTITY, self::PAYMENT_DELAYS, array_merge([ 'type' => 'int', 'input' => 'select', 'source' => Table::class, // <======== missing line 'label' => 'Payment delays', 'option' => [ 'values' => [ 1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5 ] ] ], $options) ); php where Table is Magento\Eav\Model\Entity\Attribute\Source\Table.

  • I fixed it by following query: php $sql = 'UPDATE eav_attribute SET source_model = :source_model WHERE entity_type_id = 1 AND attribute_code = :attribute_code'; $binding = [ 'source_model' => Table::class, 'attribute_code' => self::PAYMENT_DELAYS, ]; $setup->getConnection()->query($sql, $binding); – Tomasz Kuter Nov 9 '18 at 16:43
  • And how did you find out that this attribute is problematic? – Fayyaz Khattak Nov 9 '18 at 17:15
0

As suggested by Ubertheme in their answer, I have contacted them. They have checked in my instance, and the issue was related to the custom customer attributes with attribute_id = 223, attribute_id = 224, and attribute_id = 227. They have frontend_input = select type, but they missed the needed frontend_model value.

Therefore to solve the issue they have mentioned, I ran below SQL queries to change to text type for attributes mentioned above:

Update eav_attribute Set frontend_input = 'text' Where attribute_id = 223;
Update eav_attribute Set frontend_input = 'text' Where attribute_id = 224;
Update eav_attribute Set frontend_input = 'text' Where attribute_id = 227;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.