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

Commit

Permalink
Merge pull request #456 from Nosto/hotfix/enterprise-parent-product-l…
Browse files Browse the repository at this point in the history
…oad-permission

Fix saving simple product that has parent in a website without permission for the current user
  • Loading branch information
supercid authored Nov 16, 2018
2 parents e56a9e2 + c4b12b3 commit 6b224e2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning.

### 3.7.6
* Fix an issue in Magento Enterprise that would prevent to save a simple product if the logged user does not have permission to see the parent product.

### 3.7.5
* Handle line items without concrete product in order confirmation
* Fix price variation when customer group variation has zero price
Expand Down
12 changes: 10 additions & 2 deletions app/code/community/Nosto/Tagging/Util/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ public static function buildParentProducts(Mage_Catalog_Model_Product $product)
* product in array if no other parents were found.
*
* @param Mage_Catalog_Model_Product $product
* @suppress PhanUndeclaredClassInstanceof
* @suppress PhanTypeMismatchArgument
* @return array
*/
public static function toParentProducts(Mage_Catalog_Model_Product $product)
Expand All @@ -75,8 +77,14 @@ public static function toParentProducts(Mage_Catalog_Model_Product $product)
$parentIds = $model->getParentIdsByChild($product->getId());
if (!empty($parentIds)) {
foreach ($parentIds as $productId) {
$configurable = Mage::getModel('catalog/product')->load($productId);
$parents[] = $configurable;
try {
$configurable = Mage::getModel('catalog/product')->load($productId);
$parents[] = $configurable;
} catch (\Exception $e) {
if ($e instanceof \Enterprise_AdminGws_Controller_Exception) {
Nosto_Tagging_Helper_Log::exception($e);
}
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Nosto/Tagging/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<config>
<modules>
<Nosto_Tagging>
<version>3.7.5</version>
<version>3.7.6</version>
</Nosto_Tagging>
</modules>
<global>
Expand Down

0 comments on commit 6b224e2

Please sign in to comment.