Skip to content

Commit

Permalink
closes #1805 for magento 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzaloebiz committed Sep 5, 2023
1 parent d257dee commit f16642d
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions Block/Newsletter.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Customer\Api\CustomerRepositoryInterface;
use Magento\Customer\Model\Session;

class Newsletter extends \Magento\Framework\View\Element\Template
{
Expand All @@ -35,18 +34,13 @@ class Newsletter extends \Magento\Framework\View\Element\Template
* @var CustomerRepositoryInterface
*/
private $customerRepository;
/**
* @var Session
*/
private $session;

/**
* @param \Magento\Framework\View\Element\Template\Context $context
* @param Session $customerSession
* @param \Magento\Customer\Model\Session $customerSession
* @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory
* @param \Ebizmarts\MailChimp\Helper\Data $helper
* @param CustomerRepositoryInterface $customerRepository
* @param Session $session
* @param array $data
*/
public function __construct(
Expand All @@ -55,15 +49,13 @@ public function __construct(
\Magento\Newsletter\Model\SubscriberFactory $subscriberFactory,
\Ebizmarts\MailChimp\Helper\Data $helper,
CustomerRepositoryInterface $customerRepository,
Session $session,
array $data
) {
parent::__construct($context, $data);
$this->_helper = $helper;
$this->subscriberFactory = $subscriberFactory;
$this->customerSession = $customerSession;
$this->customerRepository = $customerRepository;
$this->session = $session;
}

public function getInterest()
Expand All @@ -90,6 +82,6 @@ private function getCurrentCustomer()
}
private function getCurrentCustomerId(): int
{
return $this->session->getCustomerId();
return $this->customerSession->getCustomerId();
}
}

0 comments on commit f16642d

Please sign in to comment.