Skip to content

Commit

Permalink
Merge pull request #296 from Nosto/release/3.7.1
Browse files Browse the repository at this point in the history
Release/3.7.1
  • Loading branch information
olsi-qose authored Apr 25, 2019
2 parents 0eff2b4 + d23fff0 commit da42a10
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 11 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
All notable changes to this project will be documented in this file.
This project adheres to Semantic Versioning(http://semver.org/).

## 3.7.1
- Allow reconnecting same account to the same store in same language

## 3.7.0
- Encode HTML characters automatically
- Sort how order data is imported
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ ENV DEBIAN_FRONTEND noninteractive

# Add php-7.1 Source List
RUN apt-get -y -qq install lsb-release ca-certificates wget
RUN wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
RUN wget -4 -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
RUN sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
RUN apt-get -y -qq update

Expand Down
25 changes: 16 additions & 9 deletions controllers/front/OauthTraitAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,21 @@ function () use ($oauthTraitAdapter) {
public function save(NostoSDKAccountInterface $account)
{
$success = true;
NostoHelperContext::runInContextForEachLanguageEachShop(function () use ($account, &$success) {
if ($success
&& $account->getName() === NostoHelperConfig::getAccountName()
&& NostoHelperAccount::existsAndIsConnected()
) {
$success = false;
}
});
$currentShopId = (int)Context::getContext()->shop->id;
$currentLangId = (int)Context::getContext()->language->id;

NostoHelperContext::runInContextForEachLanguageEachShop(
function () use ($account, &$success, $currentShopId, $currentLangId) {
//Checks that nosto account does not exits or in case it exists it is for the same shop & lang
if ($success
&& $account->getName() === NostoHelperConfig::getAccountName()
&& NostoHelperAccount::existsAndIsConnected()
&& ($currentShopId !== (int)NostoHelperContext::getShopId()
|| $currentLangId !== (int)NostoHelperContext::getLanguageId())
) {
$success = false;
}
});
if (!$success) {
throw new NostoException(
sprintf(
Expand All @@ -100,7 +107,7 @@ public function save(NostoSDKAccountInterface $account)
)
);
}
NostoHelperAccount::save($account);
return NostoHelperAccount::save($account);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion nostotagging.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class NostoTagging extends Module
*
* @var string
*/
const PLUGIN_VERSION = '3.7.0';
const PLUGIN_VERSION = '3.7.1';

/**
* Internal name of the Nosto plug-in
Expand Down

0 comments on commit da42a10

Please sign in to comment.