Skip to content
This repository has been archived by the owner on Apr 26, 2022. It is now read-only.

GSTV-649 Don't call translateCategory when the idCategory is empty #48

Merged
merged 3 commits into from
Sep 4, 2019

Conversation

oparizek
Copy link
Contributor

@oparizek oparizek commented Sep 4, 2019

Now it should return an empty string instead.

https://roihunter.atlassian.net/browse/GSTV-649

@oparizek oparizek added bug Something isn't working waiting-review-martin labels Sep 4, 2019
@oparizek oparizek requested a review from martinfryc1 September 4, 2019 10:43
@oparizek oparizek self-assigned this Sep 4, 2019
@martinfryc1
Copy link
Contributor

@oparizek Please increase plugin version to 1.2.1

@@ -111,7 +111,7 @@ private function getSingleProduct($id_product, $id_lang)

private function getProductDefaultCategory($idCategory, $idLanguage)
{
if (!isset($this->categoryCache[$idCategory])) {
if ($idCategory && !isset($this->categoryCache[$idCategory])) {
$this->categoryCache[$idCategory] = $this->translateCategory($idCategory, $idLanguage);
}
return empty($this->categoryCache[$idCategory]) ? "" : $this->categoryCache[$idCategory];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure but for safety I would use return (!$idCategory || empty($this->categoryCache[$idCategory])) ? "" : $this->categoryCache[$idCategory];

@oparizek oparizek merged commit 9b325bf into master Sep 4, 2019
@martinfryc1 martinfryc1 deleted the fix-empty-default-category branch September 4, 2019 11:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants