0

When I run this command:

php bin/mangento setup:di:compile

It will throw the Error Exception below:

[ErrorException]
  Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper\Interceptor and Magento\Framework\Interc
  eption\Interceptor define the same property ($pluginLocator) in the composition of MyPool\AttrProduct\Controll
  er\Adminhtml\Product\Initialization\Helper\InterceptorCus. This might be incompatible, to improve maintaina
  bility consider using accessor methods in traits instead. Class was composed

Anybody know what this means and how to fix it?

content of file "InterceptorCus.php"

<?php
namespace MyPool\AttrProduct\Controller\Adminhtml\Product\Initialization\Helper;

/**
 * Interceptor class for @see
 * \Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper
 */
class InterceptorCus extends \Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper\Interceptor
{
    use \Magento\Framework\Interception\Interceptor;

    public function __construct(\Magento\Framework\App\RequestInterface $request, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Controller\Adminhtml\Product\Initialization\StockDataFilter $stockFilter, \Magento\Catalog\Model\Product\Initialization\Helper\ProductLinks $productLinks, \Magento\Backend\Helper\Js $jsHelper, \Magento\Framework\Stdlib\DateTime\Filter\DateTime $dateFilter)
    {
        $this->___init();
        parent::__construct($request, $storeManager, $stockFilter, $productLinks, $jsHelper, $dateFilter);
    }

}
  • Use the php bin/magento setup:di:compile-multi-tenant , and tells me if the error continues – ntzz Apr 6 '16 at 9:51
  • Are you sure that you are running this command ?? Caz i can see that there is a wrong syntax! 'mangento' is not right ! It should be magento – Asish Hira Apr 6 '16 at 10:02
0

This message means that MyPool\AttrProduct\Controller\Adminhtml\Product\Initialization\Helper\InterceptorCus has properties that do the same thing more or less and can be incompatible with one another. Try to refactor the class.

If you can share gist link to the class in question we may be able to help more.

UPDATE: The issue is that the class you extend uses the same trait as your class:

    use \Magento\Framework\Interception\Interceptor;

Remove the use statement in MyPool\AttrProduct\Controller\Adminhtml\Product\Initialization\Helper\InterceptorCus and you should be fine

  • I updated my question, detail file was shown – MrTo-Kane Apr 7 '16 at 2:46

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.