From 62cd4e506d483ef0e623cc1b5107b533bfad4463 Mon Sep 17 00:00:00 2001 From: Ionut Giuraniuc Date: Wed, 2 Aug 2023 17:35:03 +0300 Subject: [PATCH] Fixed inconsistent check for isSubscriber method. Forcing status value from subscriber object to be of same type as constant that is checked against. --- Model/Api/Customer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Model/Api/Customer.php b/Model/Api/Customer.php index 8bf43188..4996d748 100644 --- a/Model/Api/Customer.php +++ b/Model/Api/Customer.php @@ -186,7 +186,7 @@ protected function isSubscriber(\Magento\Customer\Model\Customer $customer) $subscriber = $this->subscriberFactory->create(); $subscriber->loadByEmail($customer->getEmail()); if ($subscriber->getEmail() == $customer->getEmail()) { - if ($subscriber->getStatus() === \Magento\Newsletter\Model\Subscriber::STATUS_SUBSCRIBED) { + if ((int)$subscriber->getStatus() === \Magento\Newsletter\Model\Subscriber::STATUS_SUBSCRIBED) { return true; } }