i have this error after i run the s:d:c command. How to fix this and could explain to me what happened with my DataProvider and Controller Files. I really appreciate it.
Errors during compilation: Rakuten\MemberCard\Model\Config\DataProvider Incompatible argument type: Required type: string. Actual type: \Rakuten\MemberCard\Model\Config\name; File: /var/www/html/rakuten_magento/app/code/Rakuten/MemberCard/Model/Config/DataProvider.php Rakuten\MemberCard\Controller\Adminhtml\Card\Index Incompatible argument type: Required type: \Magento\Backend\App\Action\Context. Actual type: \Magento\Framework\App\Action\Context; File: /var/www/html/rakuten_magento/app/code/Rakuten/MemberCard/Controller/Adminhtml/Card/Index.php Total Errors Count: 2
Hello @annq3sivn4281
Replace
use Magento\Framework\App\Action\Context;
With
use Magento\Backend\App\Action\Context;
It may help you!
Thank you
How about my DataProvider files. What should i do ?
Hello @annq3sivn4281
Regarding data provider file take reference from below code:
use Magento\Framework\App\Request\DataPersistorInterface;
class DataProviderFileName extends \Magento\Ui\DataProvider\AbstractDataProvider
It may help you!
Thank you
Hello @annq3sivn4281 ,
So here the issue is your file DataProvider is extending any another class, but the parent constructor section defined in DataProvider class constructor is incorrectly formed.
so the DataProvider constructor argument parameters are expecting arguments same as the extended class.
The origin of this issue could be that if this a third party module then it's dependent modules version / Magento version is changed. You can get the latest version module from vendor which is compatible to your Magento version.
If you're writing DataProvider class on your own, then make sure you inject parent constructor arguments in your extended file constructor argument with similar pattern.
If you still need further help, post constructor data of DataProvider class and the extended class constructor.
Hope it helps !