2017-02-14 16 views
0

を私はセットアップを実行する上で、次のエラーを取得しています:ディ:私のMagentoの中で2エラー:ディ:コンパイル - 互換性のない引数の型

をコンパイル互換性のない引数の型:必須タイプ:\ Magentoの\カタログ\ Model \ ProductTypes \ ConfigInterfaceを選択します。実際のタイプ:配列。

互換性のない引数のタイプ:必須のタイプ:\ Magento \ Wishlist \ Model \ WishlistFactory。実際のタイプ:配列。私はアドバンス

にこの

 <block class="MyVendor\MyModule\Block\Adminhtml\Quote\Create\Items" template="Magento_Sales::order/create/items.phtml" name="items"> 
     <block class="Magento\Sales\Block\Adminhtml\Order\Create\Items\Grid" template="Magento_Sales::quote/create/items/grid.phtml" name="items_grid"> 
      <block class="Magento\Sales\Block\Adminhtml\Order\Create\Coupons" template="Magento_Sales::order/create/form.phtml" name="coupons"> 
       <block class="Magento\Sales\Block\Adminhtml\Order\Create\Coupons\Form" template="Magento_Sales::order/create/coupons/form.phtml" name="form" /> 
      </block> 
     </block> 
    </block> 

おかげのように呼んでいる私のレイアウトで

public function __construct(
    \Magento\Backend\Block\Template\Context $context, 
    \Magento\Backend\Model\Session\Quote $sessionQuote, 
    \Magento\Sales\Model\AdminOrder\Create $orderCreate, 
    PriceCurrencyInterface $priceCurrency, 
    \Magento\Wishlist\Model\WishlistFactory $wishlistFactory, 
    \Magento\GiftMessage\Model\Save $giftMessageSave, 
    \Magento\Tax\Model\Config $taxConfig, 
    \Magento\Tax\Helper\Data $taxData, 
    \Magento\GiftMessage\Helper\Message $messageHelper, 
    StockRegistryInterface $stockRegistry, 
    StockStateInterface $stockState, 
    array $data = [] 
) { 
    $this->_messageHelper = $messageHelper; 
    $this->_wishlistFactory = $wishlistFactory; 
    $this->_giftMessageSave = $giftMessageSave; 
    $this->_taxConfig = $taxConfig; 
    $this->_taxData = $taxData; 
    $this->stockRegistry = $stockRegistry; 
    $this->stockState = $stockState; 
    parent::__construct($context, $sessionQuote, $orderCreate, $priceCurrency, $data); 
} 

そして

public function __construct(
    \Magento\Backend\Block\Context $context, 
    \Magento\Catalog\Model\ProductTypes\ConfigInterface $typeConfig, 
    array $data = [] 
) { 
    parent::__construct($context, $data); 
    $this->typeConfig = $typeConfig; 
} 

を次のようにエラーの責任

コードです

+0

エラーメッセージは自分自身で発する:特定の型/コントラクトのヒントを入力しますが、メソッド/コンストラクタを呼び出すと、配列としてパラメータを指定します。 コンテキストを提供するために、呼び出しコードを送信する必要があります。 – jojonas

+0

@jojonas更新された質問 – sree

答えて

0

多分愚かな質問ですが、コマンドを実行する前にマゼンタキャッシュをクリアしましたか?

__constructの更新時に問題が発生しましたが、キャッシュをクリアするときに修正されました。

+0

はいキャッシュをクリアして再度インデックスを作成しました – sree

0

今、あなたはこのような親のコンストラクタへのすべての引数を渡す必要があり

0

をコンパイルして確認してください。この

public function __construct(
    \Magento\Catalog\Model\ProductTypes\ConfigInterface $typeConfig 
) { 
    $this->typeConfig = $typeConfig; 
} 

のようなあなたのコンストラクタ関数を保つ:

public function __construct(
    \Magento\Backend\Block\Template\Context $context, 
    \Magento\Backend\Model\Session\Quote $sessionQuote, 
    \Magento\Sales\Model\AdminOrder\Create $orderCreate, 
    PriceCurrencyInterface $priceCurrency, 
    \Magento\Wishlist\Model\WishlistFactory $wishlistFactory, 
    \Magento\GiftMessage\Model\Save $giftMessageSave, 
    \Magento\Tax\Model\Config $taxConfig, 
    \Magento\Tax\Helper\Data $taxData, 
    \Magento\GiftMessage\Helper\Message $messageHelper, 
    StockRegistryInterface $stockRegistry, 
    StockStateInterface $stockState, 
    array $data = [] 
) { 
    $this->_messageHelper = $messageHelper; 
    $this->_wishlistFactory = $wishlistFactory; 
    $this->_giftMessageSave = $giftMessageSave; 
    $this->_taxConfig = $taxConfig; 
    $this->_taxData = $taxData; 
    $this->stockRegistry = $stockRegistry; 
    $this->stockState = $stockState; 
    //Pass All Arguments To Parent 
    parent::__construct($context, $sessionQuote, $orderCreate, $priceCurrency, $wishlistFactory, $giftMessageSave, $taxConfig, $taxData, $messageHelper, $stockRegistry, $stockState, $data); 
} 

は、あなたなら、私を知ってみましょうまだエラーがあります。

関連する問題