分类
后端

Type Error occurred when creating object: Bss\SocialLogin\Model\ResourceModel\SocialLogin\Collection\Interceptor, Argument 5 passed to

/etc/di.xml 版本问题造成

将如下改成
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <virtualType name="Bss\SocialLogin\Model\ResourceModel\SocialLogin\Collection" type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
        <arguments>
            <argument name="mainTable" xsi:type="string">bss_sociallogin</argument>
            <argument name="resourceModel" xsi:type="string">Bss\SocialLogin\Model\ResourceModel\SocialLogin</argument>
        </arguments>
    </virtualType>
    <virtualType name="Bss\SocialLogin\Model\ResourceModel\SocialLogin\Collection" type="Bss\SocialLogin\Ui\Component\DataProvider\Grid">
        <arguments>
            <argument name="mainTable" xsi:type="string">bss_sociallogin</argument>
            <argument name="resourceModel" xsi:type="string">Bss\SocialLogin\Model\ResourceModel\SocialLogin</argument>
        </arguments>
    </virtualType>
    <type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
        <arguments>
            <argument name="collections" xsi:type="array">
                <item name="sociallogin_grid_data_source" xsi:type="string">Bss\SocialLogin\Model\ResourceModel\SocialLogin\Collection</item>
            </argument>
        </arguments>
    </type>
</config>
改成这里
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
        <arguments>
            <argument name="collections" xsi:type="array">
                <item name="sociallogin_grid_data_source" xsi:type="string">Bss\SocialLogin\Model\ResourceModel\SocialLogin\Grid\Collection</item>
            </argument>
        </arguments>
    </type>
    <virtualType name="Bss\SocialLogin\Model\ResourceModel\SocialLogin\Grid\Collection" type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
        <arguments>
            <argument name="mainTable" xsi:type="string">bss_sociallogin</argument>
            <argument name="resourceModel" xsi:type="string">Bss\SocialLogin\Model\ResourceModel\SocialLogin</argument>
        </arguments>
    </virtualType>
</config>