Skip to content

Commit 9016eef

Browse files
author
Magento CICD
authored
merge magento/2.3-develop into magento-performance/MAGETWO-87675
2 parents 842b026 + 1060edf commit 9016eef

File tree

34 files changed

+321
-176
lines changed

34 files changed

+321
-176
lines changed

app/code/Magento/Catalog/view/adminhtml/ui_component/category_form.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@
176176
</fileUploader>
177177
</formElements>
178178
</field>
179-
<field name="description" template="ui/form/field" sortOrder="50" formElement="wysiwyg">
179+
<field name="description" template="Magento_Catalog/field-wysiwyg" sortOrder="50" formElement="wysiwyg">
180180
<argument name="data" xsi:type="array">
181181
<item name="config" xsi:type="array">
182182
<item name="wysiwygConfigData" xsi:type="array">
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<!--
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
-->
7+
<div class="admin__field"
8+
visible="visible"
9+
css="$data.additionalClasses"
10+
attr="'data-index': index"
11+
ifnot="stageActive">
12+
<label class="admin__field-label" if="$data.label" visible="$data.labelVisible" attr="for: uid">
13+
<span translate="label" attr="'data-config-scope': $data.scopeLabel"/>
14+
</label>
15+
<div class="admin__field-control"
16+
css="'_with-tooltip': $data.tooltip, '_with-reset': $data.showFallbackReset && $data.isDifferedFromDefault">
17+
<render args="elementTmpl" ifnot="hasAddons()"/>
18+
19+
<div class="admin__control-addon" if="hasAddons()">
20+
<render args="elementTmpl"/>
21+
22+
<label class="admin__addon-prefix" if="$data.addbefore" attr="for: uid">
23+
<span text="addbefore"/>
24+
</label>
25+
<label class="admin__addon-suffix" if="$data.addafter" attr="for: uid">
26+
<span text="addafter"/>
27+
</label>
28+
</div>
29+
30+
<render args="tooltipTpl" if="$data.tooltip"/>
31+
32+
<render args="fallbackResetTpl" if="$data.showFallbackReset && $data.isDifferedFromDefault"/>
33+
34+
<label class="admin__field-error" if="error" attr="for: uid" text="error"/>
35+
36+
<div class="admin__field-note" if="$data.notice" attr="id: noticeId">
37+
<span translate="notice"/>
38+
</div>
39+
40+
<div class="admin__additional-info" if="$data.additionalInfo" html="$data.additionalInfo"></div>
41+
42+
<render args="$data.service.template" if="$data.hasService()"/>
43+
</div>
44+
</div>
45+
46+
<render if="stageActive" args="elementTmpl"/>

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/Cms/Model/Wysiwyg/CompositeConfigProvider.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,16 @@ public function processWysiwygConfig($config)
130130
/**
131131
* Returns active editor path
132132
*
133+
* @param \Magento\Framework\DataObject $config
133134
* @return string
134135
*/
135-
private function getActiveEditorPath()
136+
private function getActiveEditorPath($config)
136137
{
137-
if (!isset($this->activeEditorPath)) {
138-
$this->activeEditorPath = $this->activeEditor->getWysiwygAdapterPath();
138+
if (!isset($this->activeEditorPath) || $this->activeEditorPath !== $config->getData('activeEditorPath')) {
139+
$this->activeEditorPath = $config->getData('activeEditorPath')
140+
? $config->getData('activeEditorPath')
141+
: $this->activeEditor->getWysiwygAdapterPath();
142+
$config->setData('activeEditorPath', $this->activeEditorPath);
139143
}
140144
return $this->activeEditorPath;
141145
}
@@ -149,7 +153,7 @@ private function getActiveEditorPath()
149153
*/
150154
private function updateConfig($config, array $configProviders)
151155
{
152-
$adapterType = $this->getActiveEditorPath();
156+
$adapterType = $this->getActiveEditorPath($config);
153157
//Extension point to update plugin settings by adapter type
154158
$providerClass = isset($configProviders[$adapterType])
155159
? $configProviders[$adapterType]

app/code/Magento/Cms/Model/Wysiwyg/Config.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,13 +201,13 @@ public function getConfig($data = [])
201201

202202
$config->setData('directives_url_quoted', preg_quote($config->getData('directives_url')));
203203

204-
if ($this->_authorization->isAllowed('Magento_Cms::media_gallery')) {
205-
$this->configProvider->processGalleryConfig($config);
206-
}
207-
208204
if (is_array($data)) {
209205
$config->addData($data);
210206
}
207+
208+
if ($this->_authorization->isAllowed('Magento_Cms::media_gallery')) {
209+
$this->configProvider->processGalleryConfig($config);
210+
}
211211
if ($config->getData('add_widgets')) {
212212
$this->configProvider->processWidgetConfig($config);
213213
}

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

app/code/Magento/Ui/view/base/web/js/form/element/wysiwyg.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ define([
2323
value: '',
2424
$wysiwygEditorButton: '',
2525
links: {
26-
value: '${ $.provider }:${ $.dataScope }'
26+
value: '${ $.provider }:${ $.dataScope }',
27+
stageActive: false
2728
},
2829
template: 'ui/form/field',
2930
elementTmpl: 'ui/form/element/wysiwyg',
31+
stageActive: false,
3032
content: '',
3133
showSpinner: false,
3234
loading: false,

dev/tests/acceptance/composer.lock

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)