- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2020
09:54 PM
06-11-2020
09:54 PM
Changing settings for the BlockInterface class in the construct function
Hello
Since the magento update in 2.3.5 , the following code no longer works:
use Magento\Widget\Block\BlockInterface; class Slick extends \Magento\CatalogWidget\Block\Product\ProductsList implements BlockInterface { const DEFAULT_LIST_TYPE = 'news'; /** * @var \Magento\Sales\Model\ResourceModel\Report\Bestsellers\CollectionFactory */ protected $_bestsellersCollectionFactory; public function __construct( // ORIGINAL ARGUMENTS \Magento\Catalog\Block\Product\Context $context, \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory, \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility, \Magento\Framework\App\Http\Context $httpContext, \Magento\Rule\Model\Condition\Sql\Builder $sqlBuilder, \Magento\CatalogWidget\Model\Rule $rule, \Magento\Widget\Helper\Conditions $conditionsHelper, \Magento\Sales\Model\ResourceModel\Report\Bestsellers\CollectionFactory $bestsellersCollectionFactory, array $data = []
The $data seems to be the problem during compile
Errors during compilation: MonModule\SlickWidget\Block\Slick Incompatible argument type: Required type: \Magento\Catalog\Api\CategoryRepositoryInterface. Actual type: array; File: /var/www/magento/app/code/MonModule/SlickWidget/Block/Slick.php
Did anyone had this problem?
Regards
Labels: