cancel
Showing results for 
Search instead for 
Did you mean: 

Changement des paramètre pour la classe BlockInterface dans le constructeur

   Did you know you can see the translated content as per your choice?

Changement des paramètre pour la classe BlockInterface dans le constructeur

Bonjour,

 

Depuis la mise à jour de magento en 2.3.5 , le code suivant ne fonctionne plus :

 

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 = []

 

Le tableau $data pose problème.

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

Quelqu'un a-t-il  eu ce problème ?