I'm using Magento 2 CE Version 2.1.0 on WAMP.
When we receive below kind of error
a:4:{i:0;s:414:"Recoverable Error: Argument 6 passed to Magento\Catalog\Controller\Adminhtml\Product\Save::__construct() must be an instance of Magento\Catalog\Api\ProductRepositoryInterface, none given, called in /var/www/magento2/var/generation/Magento/Catalog/Controller/Adminhtml/Product/Save/Interceptor.php
Will do follow steps
- Remove module folder from
var/generation - Run
magento setup:upgrade,magento setup:di:compile,magento cache:flushCommands
At the time of magento setup:di:compile
Application Code Generator takes so much time.
In overall process takes approximately 10 minutes to solve above error. Is there any better way to solve it & saving time?
-
@KhoaTruongDinh Let me check & gives u updateJackson– Jackson2016年09月06日 01:13:10 +00:00Commented Sep 6, 2016 at 1:13
-
1How about your current issue?Khoa Truong– Khoa Truong2016年09月14日 16:20:00 +00:00Commented Sep 14, 2016 at 16:20
1 Answer 1
From my experience:
We should work on developer mode when developing. This is because auto-generated classes (Proxy, Factory, Interceptor) will be generated on the fly. DI compile doesn't need in this mode, so we don't need to run it again and again.
And then, we need to delete var/generation and clear cache.