Skip to content

Commit a814747

Browse files
author
Joan He
committed
Merge remote-tracking branch 'upstream/2.3-develop' into 1-es6-2.3-develop
2 parents b03c79c + c7c7e3d commit a814747

File tree

35 files changed

+158
-67
lines changed

35 files changed

+158
-67
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ Tests:
489489
* Fixed an issue where found records in global search in Backend could not be selected via keyboard
490490
* Fixed an issue where Category menu items went out of screen when page side was reached
491491
* Fixed an issue where subcategories in menu were shown instantly when user moved mouse quickly
492-
* Fixed an issue where popup header was our of window range while creating group product
492+
* Fixed an issue where popup header was out of window range while creating group product
493493
* Fixed an issue where region field was absent in customer address form on backend for "United Kingdom" country
494494
* Fixed an ability to edit the Order from Admin panel
495495
* Fixed an issue where email could not be retrieved from \Magento\Quote\Api\Data\AddressInterface after adding an address on OnePageCheckout

app/code/Magento/Backend/view/adminhtml/web/template/dynamic-rows/grid.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969

7070
<!-- ko foreach: { data: $record().elems(), as: 'elem'} -->
7171
<td if="elem.template"
72-
visible="elem.visible"
72+
visible="elem.visible() && elem.formElement !== 'hidden'"
7373
disable="elem.disabled"
7474
css="$parent.setClasses(elem)"
7575
template="elem.template"

app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/CustomOptions.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,7 @@ protected function getPositionFieldConfig($sortOrder)
871871
'formElement' => Hidden::NAME,
872872
'dataScope' => static::FIELD_SORT_ORDER_NAME,
873873
'dataType' => Number::NAME,
874+
'visible' => false,
874875
'sortOrder' => $sortOrder,
875876
],
876877
],

app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap/Generate.php

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,15 @@
77
namespace Magento\Sitemap\Controller\Adminhtml\Sitemap;
88

99
use Magento\Backend\App\Action;
10+
use Magento\Framework\App\Action\HttpGetActionInterface;
11+
use Magento\Sitemap\Controller\Adminhtml\Sitemap;
1012
use Magento\Store\Model\App\Emulation;
1113
use Magento\Framework\App\ObjectManager;
1214

13-
class Generate extends \Magento\Sitemap\Controller\Adminhtml\Sitemap
15+
/**
16+
* Generate sitemap file
17+
*/
18+
class Generate extends Sitemap implements HttpGetActionInterface
1419
{
1520
/** @var \Magento\Store\Model\App\Emulation $appEmulation */
1621
private $appEmulation;
@@ -44,23 +49,14 @@ public function execute()
4449
// if sitemap record exists
4550
if ($sitemap->getId()) {
4651
try {
47-
//We need to emulate to get the correct frontend URL for the product images
48-
$this->appEmulation->startEnvironmentEmulation(
49-
$sitemap->getStoreId(),
50-
\Magento\Framework\App\Area::AREA_FRONTEND,
51-
true
52-
);
5352
$sitemap->generateXml();
54-
5553
$this->messageManager->addSuccessMessage(
5654
__('The sitemap "%1" has been generated.', $sitemap->getSitemapFilename())
5755
);
5856
} catch (\Magento\Framework\Exception\LocalizedException $e) {
5957
$this->messageManager->addErrorMessage($e->getMessage());
6058
} catch (\Exception $e) {
6159
$this->messageManager->addExceptionMessage($e, __('We can\'t generate the sitemap right now.'));
62-
} finally {
63-
$this->appEmulation->stopEnvironmentEmulation();
6460
}
6561
} else {
6662
$this->messageManager->addErrorMessage(__('We can\'t find a sitemap to generate.'));

app/code/Magento/Sitemap/Model/Observer.php

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*/
66
namespace Magento\Sitemap\Model;
77

8-
use Magento\Store\Model\App\Emulation;
98
use Magento\Sitemap\Model\EmailNotification as SitemapEmail;
109
use Magento\Framework\App\Config\ScopeConfigInterface;
1110
use Magento\Sitemap\Model\ResourceModel\Sitemap\CollectionFactory;
@@ -57,11 +56,6 @@ class Observer
5756
*/
5857
private $collectionFactory;
5958

60-
/**
61-
* @var Emulation
62-
*/
63-
private $appEmulation;
64-
6559
/**
6660
* @var $emailNotification
6761
*/
@@ -72,17 +66,14 @@ class Observer
7266
* @param ScopeConfigInterface $scopeConfig
7367
* @param CollectionFactory $collectionFactory
7468
* @param EmailNotification $emailNotification
75-
* @param Emulation $appEmulation
7669
*/
7770
public function __construct(
7871
ScopeConfigInterface $scopeConfig,
7972
CollectionFactory $collectionFactory,
80-
SitemapEmail $emailNotification,
81-
Emulation $appEmulation
73+
SitemapEmail $emailNotification
8274
) {
8375
$this->scopeConfig = $scopeConfig;
8476
$this->collectionFactory = $collectionFactory;
85-
$this->appEmulation = $appEmulation;
8677
$this->emailNotification = $emailNotification;
8778
}
8879

@@ -114,17 +105,9 @@ public function scheduledGenerateSitemaps()
114105
foreach ($collection as $sitemap) {
115106
/* @var $sitemap \Magento\Sitemap\Model\Sitemap */
116107
try {
117-
$this->appEmulation->startEnvironmentEmulation(
118-
$sitemap->getStoreId(),
119-
\Magento\Framework\App\Area::AREA_FRONTEND,
120-
true
121-
);
122-
123108
$sitemap->generateXml();
124109
} catch (\Exception $e) {
125110
$errors[] = $e->getMessage();
126-
} finally {
127-
$this->appEmulation->stopEnvironmentEmulation();
128111
}
129112
}
130113
if ($errors && $recipient) {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ protected function _prepareProduct(array $productRow, $storeId)
389389
*/
390390
protected function _loadProductImages($product, $storeId)
391391
{
392+
$this->_storeManager->setCurrentStore($storeId);
392393
/** @var $helper \Magento\Sitemap\Helper\Data */
393394
$helper = $this->_sitemapData;
394395
$imageIncludePolicy = $helper->getProductImageIncludePolicy($storeId);

app/code/Magento/Sitemap/Test/Unit/Model/ObserverTest.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public function testScheduledGenerateSitemapsSendsExceptionEmail()
118118
->method('getStoreId')
119119
->willReturn($storeId);
120120

121-
$this->sitemapMock->expects($this->at(1))
121+
$this->sitemapMock->expects($this->once())
122122
->method('generateXml')
123123
->willThrowException(new \Exception($exception));
124124

@@ -130,17 +130,6 @@ public function testScheduledGenerateSitemapsSendsExceptionEmail()
130130
)
131131
->willReturn('error-recipient@example.com');
132132

133-
$this->appEmulationMock->expects($this->at(0))
134-
->method('startEnvironmentEmulation')
135-
->with(
136-
$storeId,
137-
Area::AREA_FRONTEND,
138-
true
139-
);
140-
141-
$this->appEmulationMock->expects($this->at(1))
142-
->method('stopEnvironmentEmulation');
143-
144133
$this->observer->scheduledGenerateSitemaps();
145134
}
146135
}

app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,6 +1238,11 @@ define([
12381238

12391239
if (!_.isUndefined(gallery)) {
12401240
gallery.updateData(imagesToUpdate);
1241+
} else {
1242+
context.find(this.options.mediaGallerySelector).on('gallery:loaded', function (loadedGallery) {
1243+
loadedGallery = context.find(this.options.mediaGallerySelector).data('gallery');
1244+
loadedGallery.updateData(imagesToUpdate);
1245+
}.bind(this));
12411246
}
12421247

12431248
if (isInitial) {
@@ -1248,6 +1253,7 @@ define([
12481253
dataMergeStrategy: this.options.gallerySwitchStrategy
12491254
});
12501255
}
1256+
12511257
} else if (justAnImage && justAnImage.img) {
12521258
context.find('.product-image-photo').attr('src', justAnImage.img);
12531259
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@
143143
<arguments>
144144
<argument name="fieldMapping" xsi:type="array">
145145
<item name="id" xsi:type="string">tax_calculation_rule_id</item>
146+
<item name="code" xsi:type="string">main_table.code</item>
146147
<item name="tax_rate_ids" xsi:type="string">tax_calculation_rate_id</item>
147148
<item name="customer_tax_class_ids" xsi:type="string">cd.customer_tax_class_id</item>
148149
<item name="product_tax_class_ids" xsi:type="string">cd.product_tax_class_id</item>
@@ -154,6 +155,7 @@
154155
<arguments>
155156
<argument name="fieldMapping" xsi:type="array">
156157
<item name="id" xsi:type="string">tax_calculation_rule_id</item>
158+
<item name="code" xsi:type="string">main_table.code</item>
157159
<item name="tax_rate_ids" xsi:type="string">tax_calculation_rate_id</item>
158160
<item name="customer_tax_class_ids" xsi:type="string">cd.customer_tax_class_id</item>
159161
<item name="product_tax_class_ids" xsi:type="string">cd.product_tax_class_id</item>

app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,7 @@ define([
543543
data = this.createHeaderTemplate(cell.config);
544544
cell.config.labelVisible = false;
545545
_.extend(data, {
546+
defaultLabelVisible: data.visible(),
546547
label: cell.config.label,
547548
name: cell.name,
548549
required: !!cell.config.validation,

0 commit comments

Comments
 (0)