Skip to content

Commit 4acf599

Browse files
author
Mike Weis
committed
Merge remote-tracking branch 'mainline/develop' into develop
Conflicts: lib/internal/Magento/Framework/Api/Config/MetadataConfig.php
2 parents 16ae95a + 1c7e9f4 commit 4acf599

File tree

414 files changed

+4705
-2338
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

414 files changed

+4705
-2338
lines changed

app/code/Magento/Bundle/Api/ProductLinkManagementInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ interface ProductLinkManagementInterface
1414
* @param string $productId
1515
* @return \Magento\Bundle\Api\Data\LinkInterface[]
1616
* @throws \Magento\Framework\Exception\NoSuchEntityException
17-
* @throws \Magento\Webapi\Exception
17+
* @throws \Magento\Framework\Exception\InputException
1818
*/
1919
public function getChildren($productId);
2020

@@ -53,7 +53,7 @@ public function addChild(
5353
* @param int $optionId
5454
* @param string $childSku
5555
* @throws \Magento\Framework\Exception\NoSuchEntityException
56-
* @throws \Magento\Webapi\Exception
56+
* @throws \Magento\Framework\Exception\InputException
5757
* @return bool
5858
*/
5959
public function removeChild($productSku, $optionId, $childSku);

app/code/Magento/Bundle/Api/ProductOptionManagementInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ interface ProductOptionManagementInterface
1414
* @param \Magento\Bundle\Api\Data\OptionInterface $option
1515
* @return int
1616
* @throws \Magento\Framework\Exception\CouldNotSaveException
17-
* @throws \Magento\Webapi\Exception
17+
* @throws \Magento\Framework\Exception\InputException
1818
*/
1919
public function save(\Magento\Bundle\Api\Data\OptionInterface $option);
2020
}

app/code/Magento/Bundle/Api/ProductOptionRepositoryInterface.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ interface ProductOptionRepositoryInterface
1515
* @param int $optionId
1616
* @return \Magento\Bundle\Api\Data\OptionInterface
1717
* @throws \Magento\Framework\Exception\NoSuchEntityException
18-
* @throws \Magento\Webapi\Exception
18+
* @throws \Magento\Framework\Exception\InputException
1919
*/
2020
public function get($productSku, $optionId);
2121

@@ -25,7 +25,7 @@ public function get($productSku, $optionId);
2525
* @param string $productSku
2626
* @return \Magento\Bundle\Api\Data\OptionInterface[]
2727
* @throws \Magento\Framework\Exception\NoSuchEntityException
28-
* @throws \Magento\Webapi\Exception
28+
* @throws \Magento\Framework\Exception\InputException
2929
*/
3030
public function getList($productSku);
3131

@@ -35,7 +35,7 @@ public function getList($productSku);
3535
* @param \Magento\Bundle\Api\Data\OptionInterface $option
3636
* @return bool
3737
* @throws \Magento\Framework\Exception\CouldNotSaveException
38-
* @throws \Magento\Webapi\Exception
38+
* @throws \Magento\Framework\Exception\InputException
3939
*/
4040
public function delete(\Magento\Bundle\Api\Data\OptionInterface $option);
4141

@@ -46,7 +46,7 @@ public function delete(\Magento\Bundle\Api\Data\OptionInterface $option);
4646
* @param int $optionId
4747
* @return bool
4848
* @throws \Magento\Framework\Exception\CouldNotSaveException
49-
* @throws \Magento\Webapi\Exception
49+
* @throws \Magento\Framework\Exception\InputException
5050
*/
5151
public function deleteById($productSku, $optionId);
5252

@@ -57,7 +57,7 @@ public function deleteById($productSku, $optionId);
5757
* @param \Magento\Bundle\Api\Data\OptionInterface $option
5858
* @return int
5959
* @throws \Magento\Framework\Exception\CouldNotSaveException
60-
* @throws \Magento\Webapi\Exception
60+
* @throws \Magento\Framework\Exception\InputException
6161
*/
6262
public function save(
6363
\Magento\Catalog\Api\Data\ProductInterface $product,

app/code/Magento/Bundle/Model/LinkManagement.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,8 @@ public function getChildren($productId)
7979
{
8080
$product = $this->productRepository->get($productId);
8181
if ($product->getTypeId() != \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE) {
82-
throw new \Magento\Webapi\Exception(
83-
'Only implemented for bundle product',
84-
\Magento\Webapi\Exception::HTTP_FORBIDDEN
82+
throw new InputException(
83+
'Only implemented for bundle product'
8584
);
8685
}
8786

@@ -186,9 +185,8 @@ public function removeChild($productSku, $optionId, $childSku)
186185
$product = $this->productRepository->get($productSku);
187186

188187
if ($product->getTypeId() != \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE) {
189-
throw new \Magento\Webapi\Exception(
190-
sprintf('Product with specified sku: %s is not a bundle product', $productSku),
191-
\Magento\Webapi\Exception::HTTP_FORBIDDEN
188+
throw new InputException(
189+
sprintf('Product with specified sku: %s is not a bundle product', $productSku)
192190
);
193191
}
194192

app/code/Magento/Bundle/Model/OptionManagement.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
namespace Magento\Bundle\Model;
88

9-
use Magento\Webapi\Exception;
9+
use Magento\Framework\Exception\InputException;
1010

1111
class OptionManagement implements \Magento\Bundle\Api\ProductOptionManagementInterface
1212
{
@@ -39,7 +39,7 @@ public function save(\Magento\Bundle\Api\Data\OptionInterface $option)
3939
{
4040
$product = $this->productRepository->get($option->getSku());
4141
if ($product->getTypeId() != \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE) {
42-
throw new Exception('Only implemented for bundle product', Exception::HTTP_FORBIDDEN);
42+
throw new InputException('Only implemented for bundle product');
4343
}
4444
return $this->optionRepository->save($product, $option);
4545
}

app/code/Magento/Bundle/Model/OptionRepository.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
namespace Magento\Bundle\Model;
88

99
use Magento\Framework\Exception\CouldNotSaveException;
10+
use Magento\Framework\Exception\InputException;
1011
use Magento\Framework\Exception\NoSuchEntityException;
11-
use Magento\Webapi\Exception;
1212

1313
/**
1414
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -219,13 +219,13 @@ public function save(
219219
/**
220220
* @param string $productSku
221221
* @return \Magento\Catalog\Api\Data\ProductInterface
222-
* @throws Exception
222+
* @throws \Magento\Framework\Exception\InputException
223223
*/
224224
private function getProduct($productSku)
225225
{
226226
$product = $this->productRepository->get($productSku);
227227
if ($product->getTypeId() != \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE) {
228-
throw new Exception('Only implemented for bundle product', Exception::HTTP_FORBIDDEN);
228+
throw new InputException('Only implemented for bundle product');
229229
}
230230
return $product;
231231
}

app/code/Magento/Bundle/composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@
1717
"magento/module-eav": "0.42.0-beta10",
1818
"magento/module-gift-message": "0.42.0-beta10",
1919
"magento/framework": "0.42.0-beta10",
20-
"magento/module-webapi": "0.42.0-beta10",
2120
"magento/module-quote": "0.42.0-beta10",
2221
"magento/magento-composer-installer": "*"
2322
},
23+
"suggest": {
24+
"magento/module-webapi": "0.42.0-beta10"
25+
},
2426
"type": "magento2-module",
2527
"version": "0.42.0-beta10",
2628
"license": [

app/code/Magento/Catalog/Model/Product.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -843,12 +843,12 @@ public function eavReindexCallback()
843843
public function reindex()
844844
{
845845
if ($this->_catalogProduct->isDataForProductCategoryIndexerWasChanged($this) || $this->isDeleted()) {
846-
$this->_productFlatIndexerProcessor->reindexRow($this->getEntityId());
847-
$categoryIndexer = $this->indexerRegistry->get(Indexer\Product\Category::INDEXER_ID);
848-
if (!$categoryIndexer->isScheduled()) {
849-
$categoryIndexer->reindexRow($this->getId());
846+
$productCategoryIndexer = $this->indexerRegistry->get(Indexer\Product\Category::INDEXER_ID);
847+
if (!$productCategoryIndexer->isScheduled()) {
848+
$productCategoryIndexer->reindexRow($this->getId());
850849
}
851850
}
851+
$this->_productFlatIndexerProcessor->reindexRow($this->getEntityId());
852852
}
853853

854854
/**
@@ -2025,7 +2025,12 @@ public function getIdentities()
20252025
$identities[] = self::CACHE_PRODUCT_CATEGORY_TAG . '_' . $categoryId;
20262026
}
20272027
}
2028-
return $identities;
2028+
if ($this->getOrigData('status') > $this->getData('status')) {
2029+
foreach ($this->getData('category_ids') as $categoryId) {
2030+
$identities[] = self::CACHE_PRODUCT_CATEGORY_TAG . '_' . $categoryId;
2031+
}
2032+
}
2033+
return array_unique($identities);
20292034
}
20302035

20312036
/**

app/code/Magento/Catalog/etc/di.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
<item name="entity_id" xsi:type="string">entity_id</item>
9090
<item name="store_id" xsi:type="string">store_id</item>
9191
<item name="visibility" xsi:type="string">visibility</item>
92+
<item name="status" xsi:type="string">status</item>
9293
</item>
9394
</argument>
9495
<argument name="productRepository" xsi:type="object">Magento\Catalog\Api\ProductRepositoryInterface\Proxy</argument>

app/code/Magento/ConfigurableProduct/Api/LinkManagementInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function addChild($productSku, $childSku);
2929
* @param string $productSku
3030
* @param string $childSku
3131
* @throws \Magento\Framework\Exception\NoSuchEntityException
32-
* @throws \Magento\Webapi\Exception
32+
* @throws \Magento\Framework\Exception\InputException
3333
* @return bool
3434
*/
3535
public function removeChild($productSku, $childSku);

0 commit comments

Comments
 (0)