yhrhhhhh / yhr

exam
The Unlicense
0 stars 0 forks source link

Too few arguments to function Kyo\Catalog\Plugin\ProductCustomOptionsPlug::__construct() #14

Open yhrhhhhh opened 2 months ago

yhrhhhhh commented 2 months ago

发生错误的工单:美国站同步主站配置工单 错误日志 Type Error occurred when creating object: Kyo\Catalog\Plugin\ProductCustomOptionsPlug, Too few arguments to function Kyo\Catalog\Plugin\ProductCustomOptionsPlug::__construct()

错误来源: 怀疑是构造函数引发的错误

构造函数代码

    public function __construct(ResourceConnection $resource, Translator $translator, StoreManagerInterface $storeManager, ProductRepository $productRepository)
    {
        $this->resource = $resource;
        $this->connection = $resource->getConnection();
        $this->translator = $translator;
        $this->storeManager = $storeManager;
        $this->productRepository = $productRepository;
    }

详细代码 feature/task_333 最新提交。

因此,期望得知产生错误的原因,以及如果解决?

Linnzh commented 2 months ago

报错提示是 Too few arguments to function,是说你的构造函数里实际传入的参数比你定义的要少。

一般出现在,修改了构造函数的入参后,没有重新 di compile 时。