"Отсутствует необходимый аргумент $options" После перехода с magento 1.9.2.4 на 2.1.3


enter image description here

Когда я пытаюсь просмотреть всех своих перенесенных клиентов, то получаю следующую ошибку.

1 exception(s):
 Exception #0 (BadMethodCallException): Missing required argument $options    of Magento\Eav\Model\Entity\Attribute\Source\Config.

Exception #0 (BadMethodCallException): Missing required argument $options of Magento\Eav\Model\Entity\Attribute\Source\Config.
#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/AttributeMetadataConverter.php(66): Magento\Eav\Model\Entity\Attribute\AbstractAttribute->getSource()
#5 /var/www/html/vendor/magento/module-customer/Model/Metadata/CustomerMetadata.php(77): Magento\Customer\Model\AttributeMetadataConverter->createMetadataAttribute(Object(Magento\Customer\Model\Attribute))
#6 /var/www/html/vendor/magento/module-customer/Model/Metadata/CustomerMetadata.php(109): Magento\Customer\Model\Metadata\CustomerMetadata->getAttributeMetadata('assigned_sales_...')
#7 /var/www/html/vendor/magento/module-customer/Model/Metadata/CachedMetadata.php(82): Magento\Customer\Model\Metadata\CustomerMetadata->getAllAttributesMetadata()
#8 /var/www/html/vendor/magento/module-customer/Ui/Component/Listing/AttributeRepository.php(66): Magento\Customer\Model\Metadata\CachedMetadata->getAllAttributesMetadata()
#9 /var/www/html/vendor/magento/module-customer/Ui/Component/Listing/Columns.php(96): Magento\Customer\Ui\Component\Listing\AttributeRepository->getList()
#10 /var/www/html/vendor/magento/framework/View/Layout/Generator/UiComponent.php(148): Magento\Customer\Ui\Component\Listing\Columns->prepare()
#11 /var/www/html/vendor/magento/framework/View/Layout/Generator/UiComponent.php(145): Magento\Framework\View\Layout\Generator\UiComponent->prepareComponent(Object(Magento\Customer\Ui\Component\Listing\Columns))
#12 /var/www/html/vendor/magento/framework/View/Layout/Generator/UiComponent.php(126): Magento\Framework\View\Layout\Generator\UiComponent->prepareComponent(Object(Magento\Ui\Component\Listing))
#13 /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_listin...', Array, Object(Magento\Framework\View\Layout\Interceptor))
#14 /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))
#15 /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))
#16 /var/www/html/var/generation/Magento/Framework/View/Layout/Interceptor.php(89): Magento\Framework\View\Layout->generateElements()
#17 /var/www/html/vendor/magento/framework/View/Layout/Builder.php(129): Magento\Framework\View\Layout\Interceptor->generateElements()
#18 /var/www/html/vendor/magento/framework/View/Page/Builder.php(55): Magento\Framework\View\Layout\Builder->generateLayoutBlocks()
#19 /var/www/html/vendor/magento/framework/View/Layout/Builder.php(65): Magento\Framework\View\Page\Builder->generateLayoutBlocks()
#20 /var/www/html/vendor/magento/framework/View/Layout.php(244): Magento\Framework\View\Layout\Builder->build()
#21 /var/www/html/vendor/magento/framework/View/Layout.php(859): Magento\Framework\View\Layout->build()
#22 /var/www/html/var/generation/Magento/Framework/View/Layout/Interceptor.php(414): Magento\Framework\View\Layout->getBlock('menu')
#23 /var/www/html/vendor/magento/module-backend/Model/View/Result/Page.php(59): Magento\Framework\View\Layout\Interceptor->getBlock('menu')
#24 /var/www/html/var/generation/Magento/Backend/Model/View/Result/Page/Interceptor.php(24): Magento\Backend\Model\View\Result\Page->setActiveMenu('Magento_Custome...')
#25 /var/www/html/vendor/magento/module-customer/Controller/Adminhtml/Index/Index.php(26): Magento\Backend\Model\View\Result\Page\Interceptor->setActiveMenu('Magento_Custome...')
#26 /var/www/html/var/generation/Magento/Customer/Controller/Adminhtml/Index/Index/Interceptor.php(24): Magento\Customer\Controller\Adminhtml\Index\Index->execute()
#27 /var/www/html/vendor/magento/framework/App/Action/Action.php(102): Magento\Customer\Controller\Adminhtml\Index\Index\Interceptor->execute()
#28 /var/www/html/vendor/magento/module-backend/App/AbstractAction.php(226): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http))
#29 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Backend\App\AbstractAction->dispatch(Object(Magento\Framework\App\Request\Http))
#30 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Customer\Controller\Adminhtml\Index\Index\Interceptor->___callParent('dispatch', Array)
#31 /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\Index\Interceptor), Array, 'adminAuthentica...')
#32 /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))
#33 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch(Object(Magento\Customer\Controller\Adminhtml\Index\Index\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#34 /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\Index\Interceptor), Array, 'adminMassaction...')
#35 /var/www/html/vendor/magento/module-backend/App/Action/Plugin/MassactionKey.php(33): Magento\Customer\Controller\Adminhtml\Index\Index\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#36 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(142): Magento\Backend\App\Action\Plugin\MassactionKey->aroundDispatch(Object(Magento\Customer\Controller\Adminhtml\Index\Index\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#37 /var/www/html/var/generation/Magento/Customer/Controller/Adminhtml/Index/Index/Interceptor.php(39): Magento\Customer\Controller\Adminhtml\Index\Index\Interceptor->___callPlugins('dispatch', Array, Array)
#38 /var/www/html/vendor/magento/framework/App/FrontController.php(55): Magento\Customer\Controller\Adminhtml\Index\Index\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#39 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))
#40 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)
#41 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'install')
#42 /var/www/html/vendor/magento/framework/Module/Plugin/DbStatusValidator.php(69): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http))
#43 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\Framework\Module\Plugin\DbStatusValidator->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#44 /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, 'infortis_cgen_m...')
#45 /var/www/html/app/code/Infortis/Cgen/Plugin/Magento/Framework/App/FrontController.php(32): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#46 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(142): Infortis\Cgen\Plugin\Magento\Framework\App\FrontController->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#47 /var/www/html/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
#48 /var/www/html/vendor/magento/framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#49 /var/www/html/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
#50 /var/www/html/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#51 {main}

Обновление После компиляции и удаления папки генерации:

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 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 93 and defined in /var/www/html/vendor/magento/module-eav/Model/Entity/Attribute/Source/Config.php:26 
Stack trace: #0 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(93): Magento\Eav\Model\Entity\Attribute\Source\Config->__construct(NULL) 
#1 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(88): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Eav\\Mod...', Array) 
#2 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(57): Magento\Framework\ObjectManager\Factory\Compiled->create('Magento\\Eav\\Mod...', Array) 
#3 /var/www/html/vendor/magento/framework/Validator/UniversalFactory.php(36): Magento\Framework\ObjectManager\ObjectManager->create('Magento\\Eav\\Mod...', Arr in /var/www/html/vendor/magento/module-eav/Model/Entity/Attribute/Source/Config.php on line 26
Author: Nitesh, 2017-03-07

4 answers

Перейти к файлу var/www/html/vendor/magento/module-customer/Model/Config.php

Измените на строку 26, в ней будет дано подробное описание ошибки public function __construct(array $options) чтобы public function __construct($options)

Подробное описание ошибки

    Exception #0 (Magento\Framework\Exception\LocalizedException): No options found.
    #0 /var/www/html/vendor/magento/module-customer/Model/AttributeMetadataConverter.php(66): Magento\Eav\Model\Entity\Attribute\Source\Config->getAllOptions()
    #1 /var/www/html/vendor/magento/module-customer/Model/Metadata/CustomerMetadata.php(77): Magento\Customer\Model\AttributeMetadataConverter->createMetadataAttribute(Object(Magento\Customer\Model\Attribute))
    #2 /var/www/html/vendor/magento/module-customer/Model/Metadata/CustomerMetadata.php(109): Magento\Customer\Model\Metadata\CustomerMetadata->getAttributeMetadata('assigned_sales_...')
    .
    .
    etc

Затем из этого описания возьмите

#0 /var/www/html/vendor/magento/module-customer/Model/AttributeMetadataConverter.php(66):

Перейдите в указанный выше файл, введите следующий код перед строкой 66

echo '<pre>';
print_r($attribute->getData());

Затем я получаю список идентификаторов атрибутов и вижу, после чего появляется ошибка идентификатора атрибута.

Итак Я получаю attribute_id 150, который не получает опций.

Поэтому я не использую этот идентификатор атрибута, поэтому я должен удалить его..

Теперь моя проблема решена, и я могу видеть всех своих перенесенных клиентов.

Пожалуйста, верните все изменения, внесенные в основные файлы.

 9
Author: Nitesh, 2017-03-08 11:40:24

Я использовал это решение для решения проблемы

  • открыть phpmyadmin
  • откройте таблицу "customer_eav_attribute"
  • узнайте, какие атрибуты импортируются, глядя на идентификатор строк

enter image description here

Как вы можете видеть из идентификатора 40, перед следующим идентификатором

есть большой пробел
  • экспортируйте резервную копию таблицы (чтобы при необходимости можно было выполнить откат)
  • удалить атрибуты, которые импортированы, но неправильно применены

В моем конкретном случае удаление строки с идентификатором 146,285,286,+ решили проблему

 4
Author: Alfredo Lanzetta, 2019-02-06 13:59:31

Для меня я удалил только строки со следующими условиями

  • Высокие идентификаторы, которые не выполнялись последовательно
  • это не системный атрибут
  • с 0 или нулевыми полями
 0
Author: Steve B, 2020-05-17 15:51:26

В моем случае проблема заключалась в пользовательском атрибуте select, в котором отсутствовал source_model.

Шаги по отладке и исправлению:

  1. xdebug - поместите поставщика точки останова/magento/framework/ObjectManager/Factory/AbstractFactory.php#L261 (создайте новое исключение \badmethod)
  2. пройдите через стек вызовов и найдите код атрибута
  3. В бд запустите запрос, чтобы получить данные атрибута "выберите *из eav_attribute, где attribute_id = [YOUR_ATTRIBUTE_ID] \G"
  4. Источник обновления модель атрибута (ЕСЛИ ОНА ПУСТА) "обновить атрибут eav_attribute, установить source_model = 'Magento\Eav\Модель\Сущность\Атрибут\Источник\Таблица', где идентификатор атрибута = [ВАШ_АТРИБУТИ_ИД];"
 0
Author: Munteanu Traian, 2020-09-15 09:13:47