Magento2: Unable to edit Customer in Backend after migration 1.6.1 to 2.1.7

Created on 4 Jul 2017  路  20Comments  路  Source: magento/magento2

Hey, after the migration from Magento 1.6.1 to 2.1.7 i am not able to edit the customer via backend. I only get this error message:

a:4:{i:0;s:87:"Missing required argument $options of Magento\Eav\Model\Entity\Attribute\Source\Config.";i:1;s:9644:"#0 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(82): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\Eav\Mod...', Array, Array)

1 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(57): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Eav\Mod...', Array)

2 /var/www/html/vendor/magento/framework/Validator/UniversalFactory.php(36): Magento\Framework\ObjectManager\ObjectManager->create('Magento\Eav\Mod...', Array)

3 /var/www/html/vendor/magento/module-eav/Model/Entity/Attribute/AbstractAttribute.php(537): Magento\Framework\Validator\UniversalFactory->create('Magento\Eav\Mod...')

4 /var/www/html/vendor/magento/module-customer/Model/Customer/DataProvider.php(337): Magento\Eav\Model\Entity\Attribute\AbstractAttribute->getSource()

5 /var/www/html/vendor/magento/module-customer/Model/Customer/DataProvider.php(162): Magento\Customer\Model\Customer\DataProvider->getAttributesMeta(Object(Magento\Eav\Model\Entity\Type))

6 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(93): Magento\Customer\Model\Customer\DataProvider->__construct('customer_form_d...', 'entity_id', 'id', Object(Magento\Ui\DataProvider\EavValidationRules), Object(Magento\Customer\Model\ResourceModel\Customer\CollectionFactory), Object(Magento\Eav\Model\Config), Object(Magento\Framework\View\Element\UiComponent\DataProvider\FilterPool), Array, Array)

7 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(89): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\Custome...', Array)

8 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(57): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Custome...', Array)

9 /var/www/html/vendor/magento/framework/View/Element/UiComponent/Argument/Interpreter/ConfigurableObject.php(60): Magento\Framework\ObjectManager\ObjectManager->create('Magento\Custome...', Array)

10 /var/www/html/var/generation/Magento/Framework/Data/Argument/InterpreterInterface/Proxy.php(95): Magento\Framework\View\Element\UiComponent\Argument\Interpreter\ConfigurableObject->evaluate(Array)

11 /var/www/html/vendor/magento/framework/Data/Argument/Interpreter/Composite.php(61): Magento\Framework\Data\Argument\InterpreterInterface\Proxy->evaluate(Array)

12 /var/www/html/vendor/magento/module-ui/Model/Manager.php(188): Magento\Framework\Data\Argument\Interpreter\Composite->evaluate(Array)

13 /var/www/html/vendor/magento/module-ui/Model/Manager.php(191): Magento\Ui\Model\Manager->evaluateComponentArguments(Array)

14 /var/www/html/vendor/magento/module-ui/Model/Manager.php(172): Magento\Ui\Model\Manager->evaluateComponentArguments(Array)

15 /var/www/html/vendor/magento/framework/View/Element/UiComponentFactory.php(144): Magento\Ui\Model\Manager->prepareData('customer_form')

16 /var/www/html/vendor/magento/framework/View/Layout/Generator/UiComponent.php(124): Magento\Framework\View\Element\UiComponentFactory->create('customer_form', NULL, Array)

17 /var/www/html/vendor/magento/framework/View/Layout/Generator/UiComponent.php(93): Magento\Framework\View\Layout\Generator\UiComponent->generateComponent(Object(Magento\Framework\View\Layout\Data\Structure), 'customer_form', Array, Object(Magento\Framework\View\Layout\Interceptor))

18 /var/www/html/vendor/magento/framework/View/Layout/GeneratorPool.php(86): Magento\Framework\View\Layout\Generator\UiComponent->process(Object(Magento\Framework\View\Layout\Reader\Context), Object(Magento\Framework\View\Layout\Generator\Context))

19 /var/www/html/vendor/magento/framework/View/Layout.php(327): Magento\Framework\View\Layout\GeneratorPool->process(Object(Magento\Framework\View\Layout\Reader\Context), Object(Magento\Framework\View\Layout\Generator\Context))

20 /var/www/html/var/generation/Magento/Framework/View/Layout/Interceptor.php(89): Magento\Framework\View\Layout->generateElements()

21 /var/www/html/vendor/magento/framework/View/Layout/Builder.php(129): Magento\Framework\View\Layout\Interceptor->generateElements()

22 /var/www/html/vendor/magento/framework/View/Page/Builder.php(55): Magento\Framework\View\Layout\Builder->generateLayoutBlocks()

23 /var/www/html/vendor/magento/framework/View/Layout/Builder.php(65): Magento\Framework\View\Page\Builder->generateLayoutBlocks()

24 /var/www/html/vendor/magento/framework/View/Layout.php(244): Magento\Framework\View\Layout\Builder->build()

25 /var/www/html/vendor/magento/framework/View/Layout.php(859): Magento\Framework\View\Layout->build()

26 /var/www/html/var/generation/Magento/Framework/View/Layout/Interceptor.php(414): Magento\Framework\View\Layout->getBlock('menu')

27 /var/www/html/vendor/magento/module-backend/Model/View/Result/Page.php(59): Magento\Framework\View\Layout\Interceptor->getBlock('menu')

28 /var/www/html/var/generation/Magento/Backend/Model/View/Result/Page/Interceptor.php(24): Magento\Backend\Model\View\Result\Page->setActiveMenu('Magento_Custome...')

29 /var/www/html/vendor/magento/module-customer/Controller/Adminhtml/Index/Edit.php(55): Magento\Backend\Model\View\Result\Page\Interceptor->setActiveMenu('Magento_Custome...')

30 /var/www/html/var/generation/Magento/Customer/Controller/Adminhtml/Index/Edit/Interceptor.php(24): Magento\Customer\Controller\Adminhtml\Index\Edit->execute()

31 /var/www/html/vendor/magento/framework/App/Action/Action.php(102): Magento\Customer\Controller\Adminhtml\Index\Edit\Interceptor->execute()

32 /var/www/html/vendor/magento/module-backend/App/AbstractAction.php(226): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http))

33 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Backend\App\AbstractAction->dispatch(Object(Magento\Framework\App\Request\Http))

34 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Customer\Controller\Adminhtml\Index\Edit\Interceptor->___callParent('dispatch', Array)

35 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\Custome...', 'dispatch', Object(Magento\Customer\Controller\Adminhtml\Index\Edit\Interceptor), Array, 'adminAuthentica...')

36 /var/www/html/vendor/magento/module-backend/App/Action/Plugin/Authentication.php(143): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain{closure}(Object(Magento\Framework\App\Request\Http))

37 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch(Object(Magento\Customer\Controller\Adminhtml\Index\Edit\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))

38 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\Custome...', 'dispatch', Object(Magento\Customer\Controller\Adminhtml\Index\Edit\Interceptor), Array, 'adminMassaction...')

39 /var/www/html/vendor/magento/module-backend/App/Action/Plugin/MassactionKey.php(33): Magento\Customer\Controller\Adminhtml\Index\Edit\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Request\Http))

40 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(142): Magento\Backend\App\Action\Plugin\MassactionKey->aroundDispatch(Object(Magento\Customer\Controller\Adminhtml\Index\Edit\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))

41 /var/www/html/var/generation/Magento/Customer/Controller/Adminhtml/Index/Edit/Interceptor.php(39): Magento\Customer\Controller\Adminhtml\Index\Edit\Interceptor->___callPlugins('dispatch', Array, Array)

42 /var/www/html/vendor/magento/framework/App/FrontController.php(55): Magento\Customer\Controller\Adminhtml\Index\Edit\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))

43 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))

44 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)

45 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'install')

46 /var/www/html/vendor/magento/framework/Module/Plugin/DbStatusValidator.php(69): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Request\Http))

47 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(142): Magento\Framework\Module\Plugin\DbStatusValidator->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))

48 /var/www/html/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)

49 /var/www/html/vendor/magento/framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))

50 /var/www/html/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()

51 /var/www/html/pub/index.php(37): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))

52 {main}";s:3:"url";s:102:"/admin_t8v8y8/customer/index/new/key/726c98b430b18497487dab56c8392590f7cd36ebb0398c95736b0ad1068f9b67/";s:11:"script_name";s:10:"/index.php";}

Format is not valid

Most helpful comment

editing this file:

vendor/magento/module-eav/Model/Entity/Attribute/Backend/arrayBackend.php

adding this method:

/**
* @return array
*/
public function getAllOptions()
{
$arr = $this->getAttribute();
//$arr=array();
$ret = [];

foreach ($arr as $key => $value) {
    $ret[] = [
    'value' => $key,
    'label' => $value
    ];
}

return $ret;

}

This solution is not good becouse, the function return a void array, but i solve for now the problem.... How we can solve definitively the problem?

All 20 comments

hi @FutureDragon

Did you get any errors on the way of migration?

Hey,
no there was no error on the way of migration.

Check your eav_attribute_label, eav_attribute_option, eav_attribute_option_value tables. Looks like they are empty or not fully migrated

I checked the tables and they are not empty and it looks like everything is there.

You can change your \Magento\Eav\Model\Entity\Attribute\Source\Config
from

public function __construct(array $options)

to

public function __construct(array $options = null)

and make a breackpoint at line

$this->_optionsData = $options;

to catch the case when $options is not set. So you would find the corresponding attribute and fix it.

Hi @victor-v-rad ,

We are facing the same issues after we migrated the data's from M1.7 to M2.1.6.
and also unable to view the customers in back office and unable to register the new users in front end.
We are getting the below error and we got the message successfully migrated.

Fatal error: Uncaught Error: Call to undefined method Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend\Interceptor::getAllOptions() in D:\xampp\htdocs\magento21\vendor\magento\module-customer\Model\AttributeMetadataConverter.php:66 Stack trace: #0 D:\xampp\htdocs\magento21\vendor\magento\module-customer\Model\Metadata\CustomerMetadata.php(77): Magento\Customer\Model\AttributeMetadataConverter->createMetadataAttribute(Object(Magento\Customer\Model\Attribute)) #1 D:\xampp\htdocs\magento21\vendor\magento\module-customer\Model\Metadata\CustomerMetadata.php(109): Magento\Customer\Model\Metadata\CustomerMetadata->getAttributeMetadata('default_blog_ca...') #2 D:\xampp\htdocs\magento21\vendor\magento\module-customer\Model\Metadata\CachedMetadata.php(82): Magento\Customer\Model\Metadata\CustomerMetadata->getAllAttributesMetadata() #3 D:\xampp\htdocs\magento21\vendor\magento\module-customer\Ui\Component\Listing\AttributeRepository.php(66): Magento\Customer\Model\Metadata\CachedMetadata->getAllAttributesMetadata() #4 D:\xampp in D:\xampp\htdocs\magento21\vendor\magento\module-customer\Model\AttributeMetadataConverter.php on line 66

We dont know how to fix the above issues.
Kindly suggest what is the issues here.

Thanks

Hi @victor-v-rad ,

Is there any updates ??

Hi @prestashoppay @FutureDragon
Please consider creating migration related issues for https://github.com/magento/data-migration-tool project.
Thank you

@FutureDragon , Thanks for your reply , i am already migrate m1.7 to m2.1 , i have issues on after migration process i mention above comment please check and let me any solutions .

@prestashoppay
Issue description is not clear enough for us to identify and verify the problem.
If you think that this is a specifically Magento 2 problem please follow reporting guidelines to report an issue. Please, edit issue description and include the preconditions, the steps required to reproduce, the actual result, and the expected result.
Please, add the following information:

  • [ ] Preconditions: Magento version
  • [ ] Steps to reproduce
  • [ ] Expected result
  • [ ] Actual result

@FutureDragon ,

After migration m1.7 to m2.1, m2.1 Admin area click sales > order view getting below error,

Issues Lilsted ,

When I open the orders they show up but when I want to view an order I see this on a blank page:
Order View Information Changes have been made to this section that have not been saved. This tab contains inval...

Please check and let me any solutions.

@FutureDragon ,

After migration m1.7 to m2.1 , m2.1 Admin area click Customers > All Customers view getting below error,

In frontend and backend when trying to create a new account I get a below error:

Fatal error: Uncaught Error: Call to undefined method Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend\Interceptor::getAllOptions() in D:\xampp\htdocs\magento21\vendor\magento\module-customer\Model\AttributeMetadataConverter.php:66 Stack trace: #0 D:\xampp\htdocs\magento21\vendor\magento\module-customer\Model\Metadata\CustomerMetadata.php(77): Magento\Customer\Model\AttributeMetadataConverter->createMetadataAttribute(Object(Magento\Customer\Model\Attribute)) #1 D:\xampp\htdocs\magento21\vendor\magento\module-customer\Model\Metadata\CustomerMetadata.php(109): Magento\Customer\Model\Metadata\CustomerMetadata->getAttributeMetadata('default_blog_ca...') #2 D:\xampp\htdocs\magento21\vendor\magento\module-customer\Model\Metadata\CachedMetadata.php(82): Magento\Customer\Model\Metadata\CustomerMetadata->getAllAttributesMetadata() #3 D:\xampp\htdocs\magento21\vendor\magento\module-customer\Ui\Component\Listing\AttributeRepository.php(66): Magento\Customer\Model\Metadata\CachedMetadata->getAllAttributesMetadata() #4 D:\xampp in D:\xampp\htdocs\magento21\vendor\magento\module-customer\Model\AttributeMetadataConverter.php on line 66

Please check and let me any solutions.

Hi @victor-v-rad ,

Any process on this issues ??

editing this file:

vendor/magento/module-eav/Model/Entity/Attribute/Backend/arrayBackend.php

adding this method:

/**
* @return array
*/
public function getAllOptions()
{
$arr = $this->getAttribute();
//$arr=array();
$ret = [];

foreach ($arr as $key => $value) {
    $ret[] = [
    'value' => $key,
    'label' => $value
    ];
}

return $ret;

}

This solution is not good becouse, the function return a void array, but i solve for now the problem.... How we can solve definitively the problem?

@ferraramax ,

Thanks a lot . I'ts Working fine .

Great..

Thanks ,

@prestashoppay, i have modified the function in previous post. Please update it. i think this version is better!

@ferrarmax , Please update your modified function put it here .

Thanks ,

@prestashoppay

public function getAllOptions()
{
$arr = $this->getAttribute();
//$arr=array();
$ret = [];

foreach ($arr as $key => $value) {
$ret[] = [
'value' => $key,
'label' => $value
];
}

return $ret;
}

$attribute = $objectManager->create('\Magento\Catalog\Model\ResourceModel\Eav\Attribute');
$attributeInfo = $attribute->getCollection()
->addFieldToFilter('attribute_code', ['eq' => "city"])
->getFirstItem();

            $id = $attributeInfo->getSource()->getOptionId($data['city']);

i'm also getting same issue

now i created with attribute 'citi' .now its working fine.

Was this page helpful?
0 / 5 - 0 ratings