Skip to content

Exception #0 (BadMethodCallException): Missing required argument $data when click on Import

We have not done changes in the files. It’s strange that When we click on System > Import , it give below error. It was working fine yesterday.

Exception #0 (BadMethodCallException): Missing required argument $data of FroogalCatalogModelImport.

#1 MagentoFrameworkObjectManagerFactoryAbstractFactory->resolveArgumentsInRuntime() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34]
#2 MagentoFrameworkObjectManagerFactoryDynamicDeveloper->_resolveArguments() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59]
#3 MagentoFrameworkObjectManagerFactoryDynamicDeveloper->create() called at [vendor/magento/framework/ObjectManager/ObjectManager.php:70]
#4 MagentoFrameworkObjectManagerObjectManager->get() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:170]
#5 MagentoFrameworkObjectManagerFactoryAbstractFactory->resolveArgument() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:276]
#6 MagentoFrameworkObjectManagerFactoryAbstractFactory->getResolvedArgument() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:239]
#7 MagentoFrameworkObjectManagerFactoryAbstractFactory->resolveArgumentsInRuntime() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34]
#8 MagentoFrameworkObjectManagerFactoryDynamicDeveloper->_resolveArguments() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59]
#9 MagentoFrameworkObjectManagerFactoryDynamicDeveloper->create() called at [vendor/magento/framework/ObjectManager/ObjectManager.php:56]
#10 MagentoFrameworkObjectManagerObjectManager->create() called at [vendor/magento/framework/View/Element/BlockFactory.php:44]
#11 MagentoFrameworkViewElementBlockFactory->createBlock() called at [vendor/magento/framework/View/Layout/Generator/Block.php:272]
#12 MagentoFrameworkViewLayoutGeneratorBlock->getBlockInstance() called at [vendor/magento/framework/View/Layout/Generator/Block.php:252]
#13 MagentoFrameworkViewLayoutGeneratorBlock->createBlock() called at [vendor/magento/framework/View/Layout/Generator/Block.php:229]
#14 MagentoFrameworkViewLayoutGeneratorBlock->generateBlock() called at [vendor/magento/framework/View/Layout/Generator/Block.php:134]
#15 MagentoFrameworkViewLayoutGeneratorBlock->process() called at [vendor/magento/framework/View/Layout/GeneratorPool.php:93]
#16 MagentoFrameworkViewLayoutGeneratorPool->process() called at [vendor/magento/framework/View/Layout.php:365]
#17 MagentoFrameworkViewLayout->generateElements() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:68]
#18 MagentoFrameworkViewLayoutInterceptor->generateElements() called at [vendor/magento/framework/View/Layout/Builder.php:129]
#19 MagentoFrameworkViewLayoutBuilder->generateLayoutBlocks() called at [vendor/magento/framework/View/Page/Builder.php:65]
#20 MagentoFrameworkViewPageBuilder->generateLayoutBlocks() called at [vendor/magento/framework/View/Layout/Builder.php:65]
#21 MagentoFrameworkViewLayoutBuilder->build() called at [vendor/magento/framework/View/Layout.php:271]
#22 MagentoFrameworkViewLayout->build() called at [vendor/magento/framework/View/Layout.php:896]
#23 MagentoFrameworkViewLayout->getBlock() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:293]
#24 MagentoFrameworkViewLayoutInterceptor->getBlock() called at [vendor/magento/module-backend/Model/View/Result/Page.php:26]
#25 MagentoBackendModelViewResultPage->setActiveMenu() called at [generated/code/Magento/Backend/Model/View/Result/Page/Interceptor.php:23]
#26 MagentoBackendModelViewResultPageInterceptor->setActiveMenu() called at [vendor/magento/module-import-export/Controller/Adminhtml/Import/Index.php:26]
#27 MagentoImportExportControllerAdminhtmlImportIndex->execute() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#28 MagentoImportExportControllerAdminhtmlImportIndexInterceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#29 MagentoImportExportControllerAdminhtmlImportIndexInterceptor->MagentoFrameworkInterception{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#30 MagentoImportExportControllerAdminhtmlImportIndexInterceptor->___callPlugins() called at [generated/code/Magento/ImportExport/Controller/Adminhtml/Import/Index/Interceptor.php:23]
#31 MagentoImportExportControllerAdminhtmlImportIndexInterceptor->execute() called at [vendor/magento/framework/App/Action/Action.php:111]
#32 MagentoFrameworkAppActionAction->dispatch() called at [vendor/magento/module-backend/App/AbstractAction.php:151]
#33 MagentoBackendAppAbstractAction->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#34 MagentoImportExportControllerAdminhtmlImportIndexInterceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#35 MagentoImportExportControllerAdminhtmlImportIndexInterceptor->MagentoFrameworkInterception{closure}() called at [vendor/magento/module-backend/App/Action/Plugin/Authentication.php:145]
#36 MagentoBackendAppActionPluginAuthentication->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#37 MagentoImportExportControllerAdminhtmlImportIndexInterceptor->MagentoFrameworkInterception{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#38 MagentoImportExportControllerAdminhtmlImportIndexInterceptor->___callPlugins() called at [generated/code/Magento/ImportExport/Controller/Adminhtml/Import/Index/Interceptor.php:32]
#39 MagentoImportExportControllerAdminhtmlImportIndexInterceptor->dispatch() called at [vendor/magento/framework/App/FrontController.php:245]
#40 MagentoFrameworkAppFrontController->getActionResponse() called at [vendor/magento/framework/App/FrontController.php:212]
#41 MagentoFrameworkAppFrontController->processRequest() called at [vendor/magento/framework/App/FrontController.php:147]
#42 MagentoFrameworkAppFrontController->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#43 MagentoFrameworkAppFrontControllerInterceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#44 MagentoFrameworkAppFrontControllerInterceptor->MagentoFrameworkInterception{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#45 MagentoFrameworkAppFrontControllerInterceptor->___callPlugins() called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:23]
#46 MagentoFrameworkAppFrontControllerInterceptor->dispatch() called at [vendor/magento/framework/App/Http.php:116]
#47 MagentoFrameworkAppHttp->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:23]
#48 MagentoFrameworkAppHttpInterceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:264]
#49 MagentoFrameworkAppBootstrap->run() called at [pub/index.php:30]

Here is full code : https://pastebin.com/0Nsp1h1N

Below is the Code : app/code/Froogal/Catalog/Model/Import – Product.php

 public function __construct(
        MagentoFrameworkJsonHelperData $jsonHelper,
        MagentoImportExportHelperData $importExportData,
        MagentoImportExportModelResourceModelImportData $importData,
        MagentoEavModelConfig $config,
        MagentoFrameworkAppResourceConnection $resource,
        MagentoImportExportModelResourceModelHelper $resourceHelper,
        MagentoFrameworkStdlibStringUtils $string,
        ProcessingErrorAggregatorInterface $errorAggregator,
        MagentoFrameworkEventManagerInterface $eventManager,
        MagentoCatalogInventoryApiStockRegistryInterface $stockRegistry,
        MagentoCatalogInventoryApiStockConfigurationInterface $stockConfiguration,
        MagentoCatalogInventoryModelSpiStockStateProviderInterface $stockStateProvider,
        MagentoCatalogHelperData $catalogData,
        MagentoImportExportModelImportConfig $importConfig,
        MagentoCatalogImportExportModelImportProxyProductResourceModelFactory $resourceFactory,
        MagentoCatalogImportExportModelImportProductOptionFactory $optionFactory,
        MagentoEavModelResourceModelEntityAttributeSetCollectionFactory $setColFactory,
        MagentoCatalogImportExportModelImportProductTypeFactory $productTypeFactory,
        MagentoCatalogModelResourceModelProductLinkFactory $linkFactory,
        MagentoCatalogImportExportModelImportProxyProductFactory $proxyProdFactory,
        MagentoCatalogImportExportModelImportUploaderFactory $uploaderFactory,
        MagentoFrameworkFilesystem $filesystem,
        MagentoCatalogInventoryModelResourceModelStockItemFactory $stockResItemFac,
        MagentoFrameworkStdlibDateTimeTimezoneInterface $localeDate,
        DateTime $dateTime,
        PsrLogLoggerInterface $logger,
        MagentoFrameworkIndexerIndexerRegistry $indexerRegistry,
        MagentoCatalogImportExportModelImportProductStoreResolver $storeResolver,
        MagentoCatalogImportExportModelImportProductSkuProcessor $skuProcessor,
        MagentoCatalogImportExportModelImportProductCategoryProcessor $categoryProcessor,
        MagentoCatalogImportExportModelImportProductValidator $validator,
        ObjectRelationProcessor $objectRelationProcessor,
        TransactionManagerInterface $transactionManager,
        MagentoCatalogImportExportModelImportProductTaxClassProcessor $taxClassProcessor,
        MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
        MagentoCatalogModelProductUrl $productUrl,
        array $data = [],
        array $dateAttrCodes = [],
        CatalogConfig $catalogConfig = null,
        ImageTypeProcessor $imageTypeProcessor = null,
        MediaGalleryProcessor $mediaProcessor = null,
        StockItemImporterInterface $stockItemImporter = null,
        DateTimeFactory $dateTimeFactory = null,
        ProductRepositoryInterface $productRepository = null,
        StatusProcessor $statusProcessor = null,
        StockProcessor $stockProcessor = null,
        LinkProcessor $linkProcessor = null,
        File $fileDriver = null,
        MagentoCatalogModelProductFactory $productFactoryData,
        MagentoCatalogModelResourceModelProductCollectionFactory $productCollectionFactory

    ) {
        $this->_eventManager = $eventManager;
        $this->stockRegistry = $stockRegistry;
        $this->stockConfiguration = $stockConfiguration;
        $this->stockStateProvider = $stockStateProvider;
        $this->_catalogData = $catalogData;
        $this->_importConfig = $importConfig;
        $this->_resourceFactory = $resourceFactory;
        $this->_setColFactory = $setColFactory;
        $this->_productTypeFactory = $productTypeFactory;
        $this->_linkFactory = $linkFactory;
        $this->_proxyProdFactory = $proxyProdFactory;
        $this->_uploaderFactory = $uploaderFactory;
        $this->filesystem = $filesystem;
        $this->_mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::ROOT);
        $this->_stockResItemFac = $stockResItemFac;
        $this->_localeDate = $localeDate;
        $this->dateTime = $dateTime;
        $this->indexerRegistry = $indexerRegistry;
        $this->_logger = $logger;
        $this->storeResolver = $storeResolver;
        $this->skuProcessor = $skuProcessor;
        $this->categoryProcessor = $categoryProcessor;
        $this->validator = $validator;
        $this->objectRelationProcessor = $objectRelationProcessor;
        $this->transactionManager = $transactionManager;
        $this->taxClassProcessor = $taxClassProcessor;
        $this->scopeConfig = $scopeConfig;
        $this->productUrl = $productUrl;
        $this->dateAttrCodes = array_merge($this->dateAttrCodes, $dateAttrCodes);
        $this->catalogConfig = $catalogConfig ?: ObjectManager::getInstance()->get(CatalogConfig::class);
        $this->imageTypeProcessor = $imageTypeProcessor ?: ObjectManager::getInstance()->get(ImageTypeProcessor::class);
        $this->mediaProcessor = $mediaProcessor ?: ObjectManager::getInstance()->get(MediaGalleryProcessor::class);
        $this->stockItemImporter = $stockItemImporter ?: ObjectManager::getInstance()
            ->get(StockItemImporterInterface::class);
        $this->statusProcessor = $statusProcessor ?: ObjectManager::getInstance()
            ->get(StatusProcessor::class);
        $this->stockProcessor = $stockProcessor ?: ObjectManager::getInstance()
            ->get(StockProcessor::class);
        $this->linkProcessor = $linkProcessor ?? ObjectManager::getInstance()
                ->get(LinkProcessor::class);
        $this->linkProcessor->addNameToIds($this->_linkNameToId);
        $this->data = $data;
        $this->productFactoryData = $productFactoryData;
        $this->productCollectionFactory = $productCollectionFactory;



        parent::__construct(
            $jsonHelper,
            $importExportData,
            $importData,
            $config,
            $resource,
            $resourceHelper,
            $string,
            $errorAggregator,
            $eventManager,
            $stockRegistry,
            $stockConfiguration,
            $stockStateProvider,
            $catalogData,$importConfig,$resourceFactory,$optionFactory,$setColFactory,$productTypeFactory,
        $linkFactory,$proxyProdFactory,$uploaderFactory,$filesystem,$stockResItemFac,$localeDate,$dateTime,$logger,$indexerRegistry,$storeResolver,$skuProcessor,$categoryProcessor,$validator,$objectRelationProcessor,$transactionManager,$taxClassProcessor,
        $scopeConfig,$productUrl,$data,$dateAttrCodes,$catalogConfig,$imageTypeProcessor,$mediaProcessor,
        $stockItemImporter,$dateTimeFactory,$productRepository,$statusProcessor,$stockProcessor,
        $linkProcessor,$fileDriver
        );

        
        $this->_optionEntity = $data['option_entity'] ??
            $optionFactory->create(['data' => ['product_entity' => $this]]);
        $this->_initAttributeSets()
            ->_initTypeModels()
            ->_initSkus()
            ->initImagesArrayKeys();
        $this->validator->init($this);
        $this->dateTimeFactory = $dateTimeFactory ?? ObjectManager::getInstance()->get(DateTimeFactory::class);
        $this->productRepository = $productRepository ?? ObjectManager::getInstance()
                ->get(ProductRepositoryInterface::class);
    }

Image :