Skip to main content
deleted 39 characters in body
Source Link
Jaimin Sutariya
  • 11.1k
  • 5
  • 36
  • 71

The error you are getting because you are overriding Account/LoginPost controller but not using its default repositories, Update your __construct function like,

public function __construct(
    Context $context,
    Session $customerSession,
    AccountManagementInterface $customerAccountManagement,
    CustomerUrl $customerHelperData,
    Validator $formKeyValidator,
    AccountRedirect $accountRedirect,
    \Magento\Wishlist\Model\WishlistFactory $wishlistRepository,
    \Magento\Catalog\Api\ProductRepositoryInterface $productRepository
) {
    $this->session = $customerSession;
    $this->customerAccountManagement = $customerAccountManagement;
    $this->customerUrl = $customerHelperData;
    $this->formKeyValidator = $formKeyValidator;
    $this->accountRedirect = $accountRedirect;
    $this->_wishlistRepository= $wishlistRepository;
    $this->_productRepository = $productRepository;
    parent::__construct($context,$customerSession,$customerAccountManagement,$customerHelperData,$formKeyValidator,$accountRedirect,$wishlistRepository,$productRepository);
}

Remove var/generation and check.

The error you are getting because you are overriding Account/LoginPost controller but not using its default repositories, Update your __construct function like,

public function __construct(
    Context $context,
    Session $customerSession,
    AccountManagementInterface $customerAccountManagement,
    CustomerUrl $customerHelperData,
    Validator $formKeyValidator,
    AccountRedirect $accountRedirect,
    \Magento\Wishlist\Model\WishlistFactory $wishlistRepository,
    \Magento\Catalog\Api\ProductRepositoryInterface $productRepository
) {
    $this->session = $customerSession;
    $this->customerAccountManagement = $customerAccountManagement;
    $this->customerUrl = $customerHelperData;
    $this->formKeyValidator = $formKeyValidator;
    $this->accountRedirect = $accountRedirect;
    $this->_wishlistRepository= $wishlistRepository;
    $this->_productRepository = $productRepository;
    parent::__construct($context,$customerSession,$customerAccountManagement,$customerHelperData,$formKeyValidator,$accountRedirect,$wishlistRepository,$productRepository);
}

Remove var/generation and check.

The error you are getting because you are overriding Account/LoginPost controller but not using its default repositories, Update your __construct function like,

public function __construct(
    Context $context,
    Session $customerSession,
    AccountManagementInterface $customerAccountManagement,
    CustomerUrl $customerHelperData,
    Validator $formKeyValidator,
    AccountRedirect $accountRedirect,
    \Magento\Wishlist\Model\WishlistFactory $wishlistRepository,
    \Magento\Catalog\Api\ProductRepositoryInterface $productRepository
) {
    $this->session = $customerSession;
    $this->customerAccountManagement = $customerAccountManagement;
    $this->customerUrl = $customerHelperData;
    $this->formKeyValidator = $formKeyValidator;
    $this->accountRedirect = $accountRedirect;
    $this->_wishlistRepository= $wishlistRepository;
    $this->_productRepository = $productRepository;
    parent::__construct($context,$customerSession,$customerAccountManagement,$customerHelperData,$formKeyValidator,$accountRedirect);
}

Remove var/generation and check.

added 24 characters in body
Source Link
Jaimin Sutariya
  • 11.1k
  • 5
  • 36
  • 71

The error you are getting because you are overriding Account/LoginPost controller but not using its default repositories, Update your __construct function like,

public function __construct(
    Context $context,
    Session $customerSession,
    AccountManagementInterface $customerAccountManagement,
    CustomerUrl $customerHelperData,
    Validator $formKeyValidator,
    AccountRedirect $accountRedirect,
    \Magento\Wishlist\Model\WishlistFactory $wishlistRepository,
    \Magento\Catalog\Api\ProductRepositoryInterface $productRepository
) {
    $this->session = $customerSession;
    $this->customerAccountManagement = $customerAccountManagement;
    $this->customerUrl = $customerHelperData;
    $this->formKeyValidator = $formKeyValidator;
    $this->accountRedirect = $accountRedirect;
    $this->_wishlistRepository= $wishlistRepository;
    $this->_productRepository = $productRepository;
    parent::__construct($context,$customerSession,$customerAccountManagement,$customerHelperData,$formKeyValidator,$accountRedirect,$wishlistRepository,$productRepository);
}

AndRemove var/generation and check.

The error you are getting because you are overriding Account/LoginPost controller but not using its default repositories, Update your __construct function like,

public function __construct(
    Context $context,
    Session $customerSession,
    AccountManagementInterface $customerAccountManagement,
    CustomerUrl $customerHelperData,
    Validator $formKeyValidator,
    AccountRedirect $accountRedirect,
    \Magento\Wishlist\Model\WishlistFactory $wishlistRepository,
    \Magento\Catalog\Api\ProductRepositoryInterface $productRepository
) {
    $this->session = $customerSession;
    $this->customerAccountManagement = $customerAccountManagement;
    $this->customerUrl = $customerHelperData;
    $this->formKeyValidator = $formKeyValidator;
    $this->accountRedirect = $accountRedirect;
    $this->_wishlistRepository= $wishlistRepository;
    $this->_productRepository = $productRepository;
    parent::__construct($context,$customerSession,$customerAccountManagement,$customerHelperData,$formKeyValidator,$accountRedirect,$wishlistRepository,$productRepository);
}

And check.

The error you are getting because you are overriding Account/LoginPost controller but not using its default repositories, Update your __construct function like,

public function __construct(
    Context $context,
    Session $customerSession,
    AccountManagementInterface $customerAccountManagement,
    CustomerUrl $customerHelperData,
    Validator $formKeyValidator,
    AccountRedirect $accountRedirect,
    \Magento\Wishlist\Model\WishlistFactory $wishlistRepository,
    \Magento\Catalog\Api\ProductRepositoryInterface $productRepository
) {
    $this->session = $customerSession;
    $this->customerAccountManagement = $customerAccountManagement;
    $this->customerUrl = $customerHelperData;
    $this->formKeyValidator = $formKeyValidator;
    $this->accountRedirect = $accountRedirect;
    $this->_wishlistRepository= $wishlistRepository;
    $this->_productRepository = $productRepository;
    parent::__construct($context,$customerSession,$customerAccountManagement,$customerHelperData,$formKeyValidator,$accountRedirect,$wishlistRepository,$productRepository);
}

Remove var/generation and check.

Updated constructor
Source Link
Jaimin Sutariya
  • 11.1k
  • 5
  • 36
  • 71

The error you are getting because you are overriding Account/LoginPost controller but not using its default repositories, Update your __construct function like,

public function __construct(
    Context $context,
    Session $customerSession,
    AccountManagementInterface $customerAccountManagement,
    CustomerUrl $customerHelperData,
    Validator $formKeyValidator,
    AccountRedirect $accountRedirect,
    \Magento\Wishlist\Model\WishlistFactory $wishlistRepository,
    \Magento\Catalog\Api\ProductRepositoryInterface $productRepository
) {
    $this->session = $customerSession;
    $this->customerAccountManagement = $customerAccountManagement;
    $this->customerUrl = $customerHelperData;
    $this->formKeyValidator = $formKeyValidator;
    $this->accountRedirect = $accountRedirect;
    $this->_wishlistRepository= $wishlistRepository;
    $this->_productRepository = $productRepository;
    parent::__construct($context,$customerSession,$customerAccountManagement,$customerHelperData,$formKeyValidator,$accountRedirect,$wishlistRepository,$productRepository);
}

And check.

The error you are getting because you are overriding Account/LoginPost controller but not using its default repositories, Update your __construct function like,

public function __construct(
    Context $context,
    Session $customerSession,
    AccountManagementInterface $customerAccountManagement,
    CustomerUrl $customerHelperData,
    Validator $formKeyValidator,
    AccountRedirect $accountRedirect,
    \Magento\Wishlist\Model\WishlistFactory $wishlistRepository,
    \Magento\Catalog\Api\ProductRepositoryInterface $productRepository
) {
    $this->session = $customerSession;
    $this->customerAccountManagement = $customerAccountManagement;
    $this->customerUrl = $customerHelperData;
    $this->formKeyValidator = $formKeyValidator;
    $this->accountRedirect = $accountRedirect;
    $this->_wishlistRepository= $wishlistRepository;
    $this->_productRepository = $productRepository;
    parent::__construct($context);
}

And check.

The error you are getting because you are overriding Account/LoginPost controller but not using its default repositories, Update your __construct function like,

public function __construct(
    Context $context,
    Session $customerSession,
    AccountManagementInterface $customerAccountManagement,
    CustomerUrl $customerHelperData,
    Validator $formKeyValidator,
    AccountRedirect $accountRedirect,
    \Magento\Wishlist\Model\WishlistFactory $wishlistRepository,
    \Magento\Catalog\Api\ProductRepositoryInterface $productRepository
) {
    $this->session = $customerSession;
    $this->customerAccountManagement = $customerAccountManagement;
    $this->customerUrl = $customerHelperData;
    $this->formKeyValidator = $formKeyValidator;
    $this->accountRedirect = $accountRedirect;
    $this->_wishlistRepository= $wishlistRepository;
    $this->_productRepository = $productRepository;
    parent::__construct($context,$customerSession,$customerAccountManagement,$customerHelperData,$formKeyValidator,$accountRedirect,$wishlistRepository,$productRepository);
}

And check.

Source Link
Jaimin Sutariya
  • 11.1k
  • 5
  • 36
  • 71
Loading