0

I am upgrading from Magento 2.2.4 to 2.3.5. I have this collection using virtualTyp made by someone else. I don't understand what's going on.

Anyone can help ? THanks !!

<virtualType name="Intelipost\Pickup\Model\Resource\Items\Collection" 
type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
    <arguments>
        <argument name="mainTable" xsi:type="string">intelipost_pickup_items</argument>
        <argument name="resourceModel" 
xsi:type="string">Intelipost\Pickup\Model\Resource\Items</argument>
    </arguments>
</virtualType>

Error message:

[2020-08-24 21:09:44] report.CRITICAL: Type Error occurred when creating object:
Intelipost\Pickup\Model\Resource\Items\Collection\Interceptor, Argument 5 passed to 
Intelipost\Pickup\Model\Resource\Items\Collection\Interceptor::__construct() must implement 
interface Magento\Framework\DB\Adapter\AdapterInterface or be null, string given, called in 
.../vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 121 [] []

This is the collection code:

<?php

namespace Intelipost\Pickup\Model\Resource\Items;

use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection;

class Collection extends AbstractCollection
{

    protected function _construct()
    {
        $this->_init(
            'Intelipost\Pickup\Model\Items',
            'Intelipost\Pickup\Model\Resource\Items'
        );
    }

}
1
0

Did you run bin/magento di:compile ? If not please run that command once. If the problem still persist then just let me know.

3
  • I surely did :) Unfortunately that's not the case. – Gustavo Ulyssea Aug 25 '20 at 12:24
  • Please check your collection class of that model. Seems to have an error with that class. Also you can share that code here. – Pradipta Sarkar Aug 25 '20 at 15:22
  • Dear @Predipta I have just added the collection code. Could not solve it yet. Help ? Thanks ! – Gustavo Ulyssea Aug 27 '20 at 18:21

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.