删除插件报错Exception #0 (ReflectionException): Class does not exist

目录

错误信息

1、插件完整名称查看

2、进入数据库删除插件安装信息

3、删除自定义类定义

方法1、通过source_model删除

方法2、通过attribute_code


错误信息

安装的插件定义了自定义类,删除插件后数据库有残留信息导致类似如下的报错信息

1 exception(s):
Exception #0 (ReflectionException): Class 类目录\自定义类名称 does not exist

Exception #0 (ReflectionException): Class 类目录\自定义类名称  does not exist
<pre>#1 Magento\Framework\Code\Reader\ClassReader->getConstructor('...') called at [vendor/magento/framework/ObjectManager/Definition/Runtime.php:54]
#2 Magento\Framework\ObjectManager\Definition\Runtime->getParameters('...') called at [vendor/magento/framework/ObjectManager/Factory/Compiled.php:100]
#3 Magento\Framework\ObjectManager\Factory\Compiled->create('...', array()) called at [vendor/magento/framework/ObjectManager/ObjectManager.php:56]
#4 Magento\Framework\ObjectManager\ObjectManager->create('...', array()) called at [vendor/magento/framework/Validator/UniversalFactory.php:36]
#5 Magento\Framework\Validator\UniversalFactory->create('...') called at [vendor/magento/module-eav/Model/Entity/Attribute/AbstractAttribute.php:642]
#6 Magento\Eav\Model\Entity\Attribute\AbstractAttribute->getSource() called at [vendor/magento/module-catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php:696]
#7 Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Eav->setupAttributeMeta(&Magento\Catalog\Model\ResourceModel\Eav\Attribute\Interceptor#0000000047d8cae20000000053183a17#, '...', 1) called at [vendor/magento/module-catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php:408]
#8 Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Eav->getContainerChildren(&Magento\Catalog\Model\ResourceModel\Eav\Attribute\Interceptor#0000000047d8cae20000000053183a17#, '...', 1) called at [vendor/magento/module-catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php:381]
#9 Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Eav->addContainerChildren(array('arguments' => array('data' => array('config' => array('formElement' => 'container', 'componentType' => 'container', 'breakLine' => false, 'label' => '...', 'required' => 0)))), &Magento\Catalog\Model\ResourceModel\Eav\Attribute\Interceptor#0000000047d8cae20000000053183a17#, '...', 1) called at [vendor/magento/module-catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php:356]
#10 Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Eav->getAttributesMeta(array(&Magento\Catalog\Model\ResourceModel\Eav\Attribute\Interceptor#0000000047d8caea0000000053183a17#, &Magento\Catalog\Model\ResourceModel\Eav\Attribute\Interceptor#0000000047d8cae20000000053183a17#, &Magento\Catalog\Model\ResourceModel\Eav\Attribute\Interceptor#0000000047d8cada0000000053183a17#), '...') called at [vendor/magento/module-catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php:316]
#11 Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Eav->modifyMeta(array('product-details' => array('children' => array(

1、插件完整名称查看

可以在插件目录的registration.php文件中找到

<?php
use Magento\Framework\Component\ComponentRegistrar;
ComponentRegistrar::register(ComponentRegistrar::MODULE, '所有者_插件名称', __DIR__);

2、进入数据库删除插件安装信息

DELETE FROM `setup_module` WHERE Module='所有者_插件名称'

3、删除自定义类定义

方法1、通过source_model删除

DELETE FROM `eav_attribute` where source_model = '类目录\\自定义类名称'

注意:“\”要改成“\\”

方法2、通过attribute_code

打开插件目录/Setup/InstallData.php文件找到类似下面的内容

$eavSetup->addAttribute(
    \Magento\Catalog\Model\Product::ENTITY,
    '自定义类编码',
    [
        'group' => '组名称',
        'type' => 'varchar',
        'backend' => '',
        'frontend' => '',
        'label' => '显示名称',
        'input' => 'select',
        'class' => '',
        'source' => \类目录\自定义类名称::class,
        'global' => ScopedAttributeInterface::SCOPE_GLOBAL,
DELETE FROM `eav_attribute` where attribute_code= '自定义类编码'

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值