Skip to content

Commit 377426e

Browse files
🔃 [EngCom] Public Pull Requests - 2.2-develop
Accepted Public Pull Requests: - #14751: Deleting CMS page via webapi/cron should remove related URL rewrites (by @unicoder88) - #14742: Allow multiple tabs ui_components on a page (by @FreekVandeursen) - magento-partners/magento2ce#68: [2.2] Add support for fotorama 'thumbmargin' setting within a theme's view.xml (by @gil--) - #12764: #4389 Widget cache error (by @AlexandrKozyr) - #14538: [Forwardport] Fix HTML tags in meta description (by @davidwindell) - #14314: #13765 Excess requests 'customer data' on checkout cart page were fixed (by @andrewbess) Fixed GitHub Issues: - #4389: Widget cache error (reported by @twslade) has been fixed in #12764 by @AlexandrKozyr in 2.2-develop branch Related commits: 1. 30b5123 - #13765: "cart" section data gets loaded 3 times on cart page (2.2.2) (reported by @erikhansen) has been fixed in #14314 by @andrewbess in 2.2-develop branch Related commits: 1. d2c6bd0 2. 42350cd
2 parents cdf370b + 674a837 commit 377426e

File tree

9 files changed

+45
-23
lines changed

9 files changed

+45
-23
lines changed

app/code/Magento/Catalog/Helper/Product/View.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ private function preparePageMetadata(ResultPage $resultPage, $product)
130130
if ($description) {
131131
$pageConfig->setDescription($description);
132132
} else {
133-
$pageConfig->setDescription($this->string->substr($product->getDescription(), 0, 255));
133+
$pageConfig->setDescription($this->string->substr(strip_tags($product->getDescription()), 0, 255));
134134
}
135135

136136
if ($this->_catalogProduct->canUseCanonicalTag()) {

app/code/Magento/Catalog/view/frontend/templates/product/view/gallery.phtml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@
6868
"thumbheight": <?php /* @escapeNotVerified */ echo $block->getImageAttribute('product_page_image_small', 'height')
6969
?: $block->getImageAttribute('product_page_image_small', 'width'); ?>,
7070
<?php endif; ?>
71+
<?php if (($block->getVar("gallery/thumbmargin"))): ?>
72+
"thumbmargin": <?= /* @noEscape */ (int)$block->getVar("gallery/thumbmargin"); ?>,
73+
<?php endif; ?>
7174
<?php if ($block->getImageAttribute('product_page_image_medium', 'height') || $block->getImageAttribute('product_page_image_medium', 'width')): ?>
7275
"height": <?php /* @escapeNotVerified */ echo $block->getImageAttribute('product_page_image_medium', 'height')
7376
?: $block->getImageAttribute('product_page_image_medium', 'width'); ?>,

app/code/Magento/CatalogWidget/Block/Product/ProductsList.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,9 @@ public function getCacheKeyInfo()
167167
intval($this->getRequest()->getParam($this->getData('page_var_name'), 1)),
168168
$this->getProductsPerPage(),
169169
$conditions,
170-
$this->json->serialize($this->getRequest()->getParams())
170+
$this->json->serialize($this->getRequest()->getParams()),
171+
$this->getTemplate(),
172+
$this->getTitle()
171173
];
172174
}
173175

app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ protected function setUp()
8787
{
8888
$this->collectionFactory =
8989
$this->getMockBuilder(\Magento\Catalog\Model\ResourceModel\Product\CollectionFactory::class)
90-
->setMethods(['create'])
91-
->disableOriginalConstructor()->getMock();
90+
->setMethods(['create'])
91+
->disableOriginalConstructor()->getMock();
9292
$this->visibility = $this->getMockBuilder(\Magento\Catalog\Model\Product\Visibility::class)
9393
->setMethods(['getVisibleInCatalogIds'])
9494
->disableOriginalConstructor()
@@ -144,6 +144,8 @@ public function testGetCacheKeyInfo()
144144
$this->productsList->setData('conditions', 'some_serialized_conditions');
145145

146146
$this->productsList->setData('page_var_name', 'page_number');
147+
$this->productsList->setTemplate('test_template');
148+
$this->productsList->setData('title', 'test_title');
147149
$this->request->expects($this->once())->method('getParam')->with('page_number')->willReturn(1);
148150

149151
$this->request->expects($this->once())->method('getParams')->willReturn('request_params');
@@ -166,7 +168,9 @@ public function testGetCacheKeyInfo()
166168
1,
167169
5,
168170
'some_serialized_conditions',
169-
json_encode('request_params')
171+
json_encode('request_params'),
172+
'test_template',
173+
'test_title'
170174
];
171175
$this->assertEquals($cacheKey, $this->productsList->getCacheKeyInfo());
172176
}
@@ -251,9 +255,10 @@ public function testGetPagerHtml()
251255
* Test public `createCollection` method and protected `getPageSize` method via `createCollection`
252256
*
253257
* @param bool $pagerEnable
254-
* @param int $productsCount
255-
* @param int $productsPerPage
256-
* @param int $expectedPageSize
258+
* @param int $productsCount
259+
* @param int $productsPerPage
260+
* @param int $expectedPageSize
261+
*
257262
* @dataProvider createCollectionDataProvider
258263
*/
259264
public function testCreateCollection($pagerEnable, $productsCount, $productsPerPage, $expectedPageSize)
@@ -382,6 +387,7 @@ public function testGetIdentities()
382387

383388
/**
384389
* @param $collection
390+
*
385391
* @return \PHPUnit_Framework_MockObject_MockObject
386392
*/
387393
private function getConditionsForCollection($collection)

app/code/Magento/Checkout/view/frontend/web/js/model/totals.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,20 @@ define([
1414
'use strict';
1515

1616
var quoteItems = ko.observable(quote.totals().items),
17-
cartData = customerData.get('cart'),
18-
quoteSubtotal = parseFloat(quote.totals().subtotal),
19-
subtotalAmount = parseFloat(cartData().subtotalAmount);
17+
cartData = customerData.get('cart');
2018

2119
quote.totals.subscribe(function (newValue) {
2220
quoteItems(newValue.items);
2321
});
2422

25-
if (quoteSubtotal !== subtotalAmount) {
26-
customerData.reload(['cart'], false);
27-
}
23+
cartData.subscribe(function () {
24+
var quoteSubtotal = parseFloat(quote.totals().subtotal),
25+
subtotalAmount = parseFloat(cartData().subtotalAmount);
26+
27+
if (quoteSubtotal !== subtotalAmount) {
28+
customerData.reload(['cart'], false);
29+
}
30+
}, this);
2831

2932
return {
3033
totals: quote.totals,

app/code/Magento/Checkout/view/frontend/web/js/view/minicart.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,17 @@ define([
9494
this.isLoading(addToCartCalls > 0);
9595
sidebarInitialized = false;
9696
this.update(updatedCart);
97+
98+
if (cartData()['website_id'] !== window.checkout.websiteId) {
99+
customerData.reload(['cart'], false);
100+
}
97101
initSidebar();
98102
}, this);
99103
$('[data-block="minicart"]').on('contentLoading', function () {
100104
addToCartCalls++;
101105
self.isLoading(true);
102106
});
103107

104-
if (cartData()['website_id'] !== window.checkout.websiteId) {
105-
customerData.reload(['cart'], false);
106-
}
107-
108108
return this._super();
109109
},
110110
isLoading: ko.observable(false),

app/code/Magento/Customer/view/frontend/web/js/customer-data.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,11 @@ define([
232232
if (!_.isEmpty(privateContent)) {
233233
countryData = this.get('directory-data');
234234

235-
if (_.isEmpty(countryData())) {
236-
customerData.reload(['directory-data'], false);
237-
}
235+
countryData.subscribe(function () {
236+
if (_.isEmpty(countryData())) {
237+
customerData.reload(['directory-data'], false);
238+
}
239+
}, this);
238240
}
239241
},
240242

app/code/Magento/Ui/Component/Layout/Tabs.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,15 +350,21 @@ protected function initAreas()
350350
protected function addNavigationBlock()
351351
{
352352
$pageLayout = $this->component->getContext()->getPageLayout();
353+
354+
$navName = 'tabs_nav';
355+
if ($pageLayout->hasElement($navName)) {
356+
$navName = $this->component->getName() . '_tabs_nav';
357+
}
358+
353359
/** @var \Magento\Ui\Component\Layout\Tabs\Nav $navBlock */
354360
if (isset($this->navContainerName)) {
355361
$navBlock = $pageLayout->addBlock(
356362
\Magento\Ui\Component\Layout\Tabs\Nav::class,
357-
'tabs_nav',
363+
$navName,
358364
$this->navContainerName
359365
);
360366
} else {
361-
$navBlock = $pageLayout->addBlock(\Magento\Ui\Component\Layout\Tabs\Nav::class, 'tabs_nav', 'content');
367+
$navBlock = $pageLayout->addBlock(\Magento\Ui\Component\Layout\Tabs\Nav::class, $navName, 'content');
362368
}
363369
$navBlock->setTemplate('Magento_Ui::layout/tabs/nav/default.phtml');
364370
$navBlock->setData('data_scope', $this->namespace);

0 commit comments

Comments
 (0)