Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 37d8bf1

Browse files
🔃 [EngCom] Public Pull Requests - 2.3-develop
Accepted Public Pull Requests: - magento/magento2#13616: Forwardport-pull-13485: Update code formatting in Swagger Block (by @p-bystritsky) - magento/magento2#13615: Forwardport-pull-13462: Switch updatecart qty input validators to dynamic instead of hardcoding (by @p-bystritsky) - magento/magento2#13506: Fix load order of view.xml when loading Swatch config (by @pmclain) Fixed GitHub Issues: - magento/magento2#12647: Image Swatch size change not working (reported by @joachim-havloujian) has been fixed in magento/magento2#13506 by @pmclain in 2.3-develop branch Related commits: 1. dfd734e
2 parents 2f888a3 + f9278c1 commit 37d8bf1

File tree

4 files changed

+10
-38
lines changed

4 files changed

+10
-38
lines changed

app/code/Magento/Checkout/view/frontend/templates/cart/item/configure/updatecart.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
value=""
2424
title="<?= /* @escapeNotVerified */ __('Qty') ?>"
2525
class="input-text qty"
26-
data-validate="{'required-number':true,digits:true}"/>
26+
data-validate="<?= $block->escapeHtml(json_encode($block->getQuantityValidators())) ?>"/>
2727
</div>
2828
</div>
2929
<?php endif; ?>

app/code/Magento/Swagger/view/frontend/templates/swagger-ui/index.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Modified by Magento, Modifications Copyright © Magento, Inc. All rights reserved.
1313
*/
1414

15-
/** @var \Magento\Framework\View\Element\Template $block */
15+
/** @var \Magento\Swagger\Block\Index $block */
1616

1717
$schemaUrl = $block->getSchemaUrl();
1818
?>

app/code/Magento/Swatches/Helper/Media.php

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ class Media extends \Magento\Framework\App\Helper\AbstractHelper
6868
protected $swatchImageTypes = ['swatch_image', 'swatch_thumb'];
6969

7070
/**
71-
* @var \Magento\Theme\Model\ResourceModel\Theme\Collection
71+
* @var array
7272
*/
73-
private $registeredThemesCache;
73+
private $imageConfig;
7474

7575
/**
7676
* @param \Magento\Catalog\Model\Product\Media\Config $mediaConfig
@@ -256,18 +256,14 @@ public function getFolderNameSize($swatchType, $imageConfig = null)
256256
*/
257257
public function getImageConfig()
258258
{
259-
$imageConfig = [];
260-
foreach ($this->getRegisteredThemes() as $theme) {
261-
$config = $this->viewConfig->getViewConfig([
262-
'area' => Area::AREA_FRONTEND,
263-
'themeModel' => $theme,
264-
]);
265-
$imageConfig = array_merge(
266-
$imageConfig,
267-
$config->getMediaEntities('Magento_Catalog', Image::MEDIA_TYPE_CONFIG_NODE)
259+
if (!$this->imageConfig) {
260+
$this->imageConfig = $this->viewConfig->getViewConfig()->getMediaEntities(
261+
'Magento_Catalog',
262+
Image::MEDIA_TYPE_CONFIG_NODE
268263
);
269264
}
270-
return $imageConfig;
265+
266+
return $this->imageConfig;
271267
}
272268

273269
/**
@@ -338,16 +334,4 @@ protected function prepareFile($file)
338334
{
339335
return ltrim(str_replace('\\', '/', $file), '/');
340336
}
341-
342-
/**
343-
* @return \Magento\Theme\Model\ResourceModel\Theme\Collection
344-
*/
345-
private function getRegisteredThemes()
346-
{
347-
if ($this->registeredThemesCache === null) {
348-
$this->registeredThemesCache = $this->themeCollection->loadRegisteredThemes();
349-
}
350-
351-
return $this->registeredThemesCache;
352-
}
353337
}

app/code/Magento/Swatches/Test/Unit/Helper/MediaTest.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ class MediaTest extends \PHPUnit\Framework\TestCase
3030
/** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\Image\Factory */
3131
protected $imageFactoryMock;
3232

33-
/** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Theme\Model\ResourceModel\Theme\Collection */
34-
protected $themeCollectionMock;
35-
3633
/** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\View\Config */
3734
protected $viewConfigMock;
3835

@@ -59,10 +56,6 @@ protected function setUp()
5956
$this->storeManagerMock = $this->createPartialMock(\Magento\Store\Model\StoreManager::class, ['getStore']);
6057

6158
$this->imageFactoryMock = $this->createMock(\Magento\Framework\Image\Factory::class);
62-
$this->themeCollectionMock = $this->createPartialMock(
63-
\Magento\Theme\Model\ResourceModel\Theme\Collection::class,
64-
['loadRegisteredThemes']
65-
);
6659

6760
$this->viewConfigMock = $this->createMock(\Magento\Framework\View\Config::class);
6861

@@ -83,7 +76,6 @@ protected function setUp()
8376
'fileStorageDb' => $this->fileStorageDbMock,
8477
'storeManager' => $this->storeManagerMock,
8578
'imageFactory' => $this->imageFactoryMock,
86-
'themeCollection' => $this->themeCollectionMock,
8779
'configInterface' => $this->viewConfigMock,
8880
]
8981
);
@@ -248,10 +240,6 @@ public function testGetImageConfig()
248240

249241
protected function generateImageConfig()
250242
{
251-
$themeMock = $this->createMock(\Magento\Theme\Model\Theme::class);
252-
$themesArrayMock = [$themeMock];
253-
$this->themeCollectionMock->expects($this->any())->method('loadRegisteredThemes')->willReturn($themesArrayMock);
254-
255243
$configMock = $this->createMock(\Magento\Framework\Config\View::class);
256244

257245
$this->viewConfigMock

0 commit comments

Comments
 (0)