diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c44ed3..55a787f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec2.0.0.h ## [3.6.9] - 2021-09-14 ### Changed - Amazon login activated permanently, removed from module settings +- Link existing newsletter subscription to new created accounts, when guest/newsletter accounts get deleted ## [3.6.8] - 2020-02-09 ### Fixed diff --git a/application/models/bestitamazonpay4oxidloginclient.php b/application/models/bestitamazonpay4oxidloginclient.php index 4fbe1e7..21c1743 100755 --- a/application/models/bestitamazonpay4oxidloginclient.php +++ b/application/models/bestitamazonpay4oxidloginclient.php @@ -180,16 +180,16 @@ public function oxidUserExists($oUserData) * * @param string $sId The id of the user * - * @return array + * @return boolean * @throws oxConnectionException */ public function oxidNewsletterSubscriptionExists($sId) { - $sSql = "SELECT * + $sSql = "SELECT OXUSERID FROM oxnewssubscribed WHERE OXUSERID = {$this->getDatabase()->quote($sId)}"; - return $this->getDatabase()->getRow($sSql); + return $this->getDatabase()->getOne($sSql); } /** diff --git a/ext/bestitamazonpay4oxid_oxcmp_user.php b/ext/bestitamazonpay4oxid_oxcmp_user.php index 892d12b..1d8ae1d 100755 --- a/ext/bestitamazonpay4oxid_oxcmp_user.php +++ b/ext/bestitamazonpay4oxid_oxcmp_user.php @@ -185,8 +185,8 @@ public function amazonLogin() ); // Check if a newsletter subscription existed on the old account - $aNewsletterData = $oLoginClient->oxidNewsletterSubscriptionExists($aUserData['OXID']); - if ($aNewsletterData['OXID']) { + $aNewsletterId = $oLoginClient->oxidNewsletterSubscriptionExists($aUserData['OXID']); + if ($aNewsletterId) { $oLoginClient->linkNewsletterToNewUser($aUserData['OXID'], $sUserId); }