0
Webkul\VendorPos\Model\ResourceModel\Orders\Grid\Collection
Incompatible argument type:
Required type: \Magento\Framework\App\Config\ScopeConfigInterface.
Actual type: \Magento\Framework\DB\Adapter\AdapterInterface;
public function __construct(
        \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory,
        \Psr\Log\LoggerInterface $logger,
        \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy,
        \Magento\Framework\Event\ManagerInterface $eventManager,
        $mainTable,
        $eventPrefix,
        $eventObject,
        $resourceModel,
        \Webkul\Marketplace\helper\Data $mpHelper,
        $model = \Magento\Framework\View\Element\UiComponent\DataProvider\Document::class,
        \Magento\Framework\DB\Adapter\AdapterInterface $connection = null,
        \Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource = null
    ) 
{
        parent::__construct(
            $entityFactory,
            $logger,
            $fetchStrategy,
            $eventManager,
            $connection,
            $resource
        );
        $this->_eventPrefix = $eventPrefix;
        $this->_eventObject = $eventObject;
        $this->mpHelper     = $mpHelper;
        $this->_init($model, $resourceModel);
        $this->setMainTable($mainTable);
}

File: /var/www/html/app/code/Webkul/VendorPos/Model/ResourceModel/Orders/Grid/Collection.php

\Magento\Framework\DB\Adapter\AdapterInterface
1
  • 1
    add your __construct() function code in question – Rakesh Varma Mar 19 at 8:27
0

Based on your question, the constructor you are using missing ScopeConfigInterface, because it's using by your parent construct.

Your code:

parent::__construct(
    $entityFactory,
    $logger,
    $fetchStrategy,
    $eventManager,
    $connection,
    $resource
);

It should be

parent::__construct(
    $entityFactory,
    $logger,
    $fetchStrategy,
    $eventManager,
    $scopeConfig,
    $connection,
    $resource
);

You will need to add the scope config into your constructor and make it matches what you see in parent::__construct().

4
  • Thank You..it solves my problem..But Again I am getting new error – Sonali Ghule Mar 19 at 10:25
  • Webkul\Marketplace\Model\Order\Pdf\Creditmemo Incompatible argument type: Required type: \Magento\Store\Model\App\Emulation. Actual type: \Magento\Framework\Locale\ResolverInterface; File: /var/www/html/app/code/Webkul/Marketplace/Model/Order/Pdf/Creditmemo.php Webkul\Marketplace\Model\Order\Pdf\Shipment Incompatible argument type: Required type: \Magento\Store\Model\App\Emulation. Actual type: \Magento\Framework\Locale\ResolverInterface; File: /var/www/html/app/code/Webkul/Marketplace/Model/Order/Pdf/Shipment.php – Sonali Ghule Mar 19 at 10:26
  • If it resolves your problem can you mark it as completed and probably create a new question for your new errors – Toan Nguyen Mar 19 at 10:27
  • ok.I will do it – Sonali Ghule Mar 19 at 10:28

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.