1

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 Froogal\Catalog\Model\Import.

#1 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34]
#2 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59]
#3 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() called at [vendor/magento/framework/ObjectManager/ObjectManager.php:70]
#4 Magento\Framework\ObjectManager\ObjectManager->get() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:170]
#5 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:276]
#6 Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:239]
#7 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34]
#8 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments() called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59]
#9 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() called at [vendor/magento/framework/ObjectManager/ObjectManager.php:56]
#10 Magento\Framework\ObjectManager\ObjectManager->create() called at [vendor/magento/framework/View/Element/BlockFactory.php:44]
#11 Magento\Framework\View\Element\BlockFactory->createBlock() called at [vendor/magento/framework/View/Layout/Generator/Block.php:272]
#12 Magento\Framework\View\Layout\Generator\Block->getBlockInstance() called at [vendor/magento/framework/View/Layout/Generator/Block.php:252]
#13 Magento\Framework\View\Layout\Generator\Block->createBlock() called at [vendor/magento/framework/View/Layout/Generator/Block.php:229]
#14 Magento\Framework\View\Layout\Generator\Block->generateBlock() called at [vendor/magento/framework/View/Layout/Generator/Block.php:134]
#15 Magento\Framework\View\Layout\Generator\Block->process() called at [vendor/magento/framework/View/Layout/GeneratorPool.php:93]
#16 Magento\Framework\View\Layout\GeneratorPool->process() called at [vendor/magento/framework/View/Layout.php:365]
#17 Magento\Framework\View\Layout->generateElements() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:68]
#18 Magento\Framework\View\Layout\Interceptor->generateElements() called at [vendor/magento/framework/View/Layout/Builder.php:129]
#19 Magento\Framework\View\Layout\Builder->generateLayoutBlocks() called at [vendor/magento/framework/View/Page/Builder.php:65]
#20 Magento\Framework\View\Page\Builder->generateLayoutBlocks() called at [vendor/magento/framework/View/Layout/Builder.php:65]
#21 Magento\Framework\View\Layout\Builder->build() called at [vendor/magento/framework/View/Layout.php:271]
#22 Magento\Framework\View\Layout->build() called at [vendor/magento/framework/View/Layout.php:896]
#23 Magento\Framework\View\Layout->getBlock() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:293]
#24 Magento\Framework\View\Layout\Interceptor->getBlock() called at [vendor/magento/module-backend/Model/View/Result/Page.php:26]
#25 Magento\Backend\Model\View\Result\Page->setActiveMenu() called at [generated/code/Magento/Backend/Model/View/Result/Page/Interceptor.php:23]
#26 Magento\Backend\Model\View\Result\Page\Interceptor->setActiveMenu() called at [vendor/magento/module-import-export/Controller/Adminhtml/Import/Index.php:26]
#27 Magento\ImportExport\Controller\Adminhtml\Import\Index->execute() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#28 Magento\ImportExport\Controller\Adminhtml\Import\Index\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#29 Magento\ImportExport\Controller\Adminhtml\Import\Index\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#30 Magento\ImportExport\Controller\Adminhtml\Import\Index\Interceptor->___callPlugins() called at [generated/code/Magento/ImportExport/Controller/Adminhtml/Import/Index/Interceptor.php:23]
#31 Magento\ImportExport\Controller\Adminhtml\Import\Index\Interceptor->execute() called at [vendor/magento/framework/App/Action/Action.php:111]
#32 Magento\Framework\App\Action\Action->dispatch() called at [vendor/magento/module-backend/App/AbstractAction.php:151]
#33 Magento\Backend\App\AbstractAction->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#34 Magento\ImportExport\Controller\Adminhtml\Import\Index\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#35 Magento\ImportExport\Controller\Adminhtml\Import\Index\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/module-backend/App/Action/Plugin/Authentication.php:145]
#36 Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#37 Magento\ImportExport\Controller\Adminhtml\Import\Index\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#38 Magento\ImportExport\Controller\Adminhtml\Import\Index\Interceptor->___callPlugins() called at [generated/code/Magento/ImportExport/Controller/Adminhtml/Import/Index/Interceptor.php:32]
#39 Magento\ImportExport\Controller\Adminhtml\Import\Index\Interceptor->dispatch() called at [vendor/magento/framework/App/FrontController.php:245]
#40 Magento\Framework\App\FrontController->getActionResponse() called at [vendor/magento/framework/App/FrontController.php:212]
#41 Magento\Framework\App\FrontController->processRequest() called at [vendor/magento/framework/App/FrontController.php:147]
#42 Magento\Framework\App\FrontController->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#43 Magento\Framework\App\FrontController\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#44 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#45 Magento\Framework\App\FrontController\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:23]
#46 Magento\Framework\App\FrontController\Interceptor->dispatch() called at [vendor/magento/framework/App/Http.php:116]
#47 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:23]
#48 Magento\Framework\App\Http\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:264]
#49 Magento\Framework\App\Bootstrap->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(
        \Magento\Framework\Json\Helper\Data $jsonHelper,
        \Magento\ImportExport\Helper\Data $importExportData,
        \Magento\ImportExport\Model\ResourceModel\Import\Data $importData,
        \Magento\Eav\Model\Config $config,
        \Magento\Framework\App\ResourceConnection $resource,
        \Magento\ImportExport\Model\ResourceModel\Helper $resourceHelper,
        \Magento\Framework\Stdlib\StringUtils $string,
        ProcessingErrorAggregatorInterface $errorAggregator,
        \Magento\Framework\Event\ManagerInterface $eventManager,
        \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry,
        \Magento\CatalogInventory\Api\StockConfigurationInterface $stockConfiguration,
        \Magento\CatalogInventory\Model\Spi\StockStateProviderInterface $stockStateProvider,
        \Magento\Catalog\Helper\Data $catalogData,
        \Magento\ImportExport\Model\Import\Config $importConfig,
        \Magento\CatalogImportExport\Model\Import\Proxy\Product\ResourceModelFactory $resourceFactory,
        \Magento\CatalogImportExport\Model\Import\Product\OptionFactory $optionFactory,
        \Magento\Eav\Model\ResourceModel\Entity\Attribute\Set\CollectionFactory $setColFactory,
        \Magento\CatalogImportExport\Model\Import\Product\Type\Factory $productTypeFactory,
        \Magento\Catalog\Model\ResourceModel\Product\LinkFactory $linkFactory,
        \Magento\CatalogImportExport\Model\Import\Proxy\ProductFactory $proxyProdFactory,
        \Magento\CatalogImportExport\Model\Import\UploaderFactory $uploaderFactory,
        \Magento\Framework\Filesystem $filesystem,
        \Magento\CatalogInventory\Model\ResourceModel\Stock\ItemFactory $stockResItemFac,
        \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate,
        DateTime $dateTime,
        \Psr\Log\LoggerInterface $logger,
        \Magento\Framework\Indexer\IndexerRegistry $indexerRegistry,
        \Magento\CatalogImportExport\Model\Import\Product\StoreResolver $storeResolver,
        \Magento\CatalogImportExport\Model\Import\Product\SkuProcessor $skuProcessor,
        \Magento\CatalogImportExport\Model\Import\Product\CategoryProcessor $categoryProcessor,
        \Magento\CatalogImportExport\Model\Import\Product\Validator $validator,
        ObjectRelationProcessor $objectRelationProcessor,
        TransactionManagerInterface $transactionManager,
        \Magento\CatalogImportExport\Model\Import\Product\TaxClassProcessor $taxClassProcessor,
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
        \Magento\Catalog\Model\Product\Url $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,
        \Magento\Catalog\Model\ProductFactory $productFactoryData,
        \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $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 :

7
  • which default class is extended? can you share path?
    – Msquare
    Dec 27, 2023 at 10:53
  • pastebin.com/0Nsp1h1N @Msquare is full code Dec 27, 2023 at 10:53
  • @Msquare do i need to delete "generated folder " ? Dec 27, 2023 at 11:00
  • You defined an improper sequence in your parent::__construct(). Please check and compare it.
    – Msquare
    Dec 27, 2023 at 11:00
  • @Msquare we have same code in staging demo site, there no problem, also it was working yesterday, not getting without doing any changes, how it happened ? Dec 27, 2023 at 11:01

1 Answer 1

2

Please execute the following command:

php -d memory_limit=-1 bin/magento s:d:c
php -d memory_limit=-1 bin/magento c:c

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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