Skip to content

Commit 61b7f5d

Browse files
committed
Merge remote-tracking branch 'origin/2.2-develop' into MC-10263
2 parents f2a98a8 + a08dd4e commit 61b7f5d

File tree

3 files changed

+30
-5
lines changed

3 files changed

+30
-5
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,10 @@ public function create($sku, ProductAttributeMediaGalleryEntryInterface $entry)
6868
$product->setMediaGalleryEntries($existingMediaGalleryEntries);
6969
try {
7070
$product = $this->productRepository->save($product);
71+
// phpcs:ignore Magento2.Exceptions.ThrowCatch
7172
} catch (InputException $inputException) {
7273
throw $inputException;
74+
// phpcs:ignore Magento2.Exceptions.ThrowCatch
7375
} catch (\Exception $e) {
7476
throw new StateException(__('Cannot save product.'));
7577
}
@@ -100,7 +102,10 @@ public function update($sku, ProductAttributeMediaGalleryEntryInterface $entry)
100102

101103
if ($existingEntry->getId() == $entry->getId()) {
102104
$found = true;
103-
if ($entry->getFile()) {
105+
106+
$file = $entry->getContent();
107+
108+
if ($file && $file->getBase64EncodedData() || $entry->getFile()) {
104109
$entry->setId(null);
105110
}
106111
$existingMediaGalleryEntries[$key] = $entry;

app/code/Magento/Cms/Block/Block.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,14 @@ public function getIdentities()
8484
{
8585
return [\Magento\Cms\Model\Block::CACHE_TAG . '_' . $this->getBlockId()];
8686
}
87+
88+
/**
89+
* @inheritdoc
90+
*/
91+
public function getCacheKeyInfo()
92+
{
93+
$cacheKeyInfo = parent::getCacheKeyInfo();
94+
$cacheKeyInfo[] = $this->_storeManager->getStore()->getId();
95+
return $cacheKeyInfo;
96+
}
8797
}

app/code/Magento/Reports/Model/ResourceModel/Product/Downloads/Collection.php

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
* See COPYING.txt for license details.
55
*/
66

7+
namespace Magento\Reports\Model\ResourceModel\Product\Downloads;
8+
79
/**
810
* Product Downloads Report collection
911
*
1012
* @author Magento Core Team <core@magentocommerce.com>
11-
*/
12-
namespace Magento\Reports\Model\ResourceModel\Product\Downloads;
13-
14-
/**
13+
*
1514
* @api
1615
* @since 100.0.2
16+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
1717
*/
1818
class Collection extends \Magento\Catalog\Model\ResourceModel\Product\Collection
1919
{
@@ -97,4 +97,14 @@ public function addFieldToFilter($field, $condition = null)
9797
}
9898
return $this;
9999
}
100+
101+
/**
102+
* @inheritDoc
103+
*/
104+
public function getSelectCountSql()
105+
{
106+
$countSelect = parent::getSelectCountSql();
107+
$countSelect->reset(\Zend\Db\Sql\Select::GROUP);
108+
return $countSelect;
109+
}
100110
}

0 commit comments

Comments
 (0)