Skip to content

Commit 365e400

Browse files
Merge pull request #3475 from magento-engcom/2.3-develop-prs
[EngCom] Public Pull Requests - 2.3-develop
2 parents 1a805d0 + 07510d8 commit 365e400

File tree

18 files changed

+319
-223
lines changed

18 files changed

+319
-223
lines changed

app/code/Magento/Catalog/Controller/Product/Compare.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Magento\Catalog\Controller\Product;
77

88
use Magento\Catalog\Api\ProductRepositoryInterface;
9+
use Magento\Framework\App\Action\HttpGetActionInterface;
910
use Magento\Framework\Data\Form\FormKey\Validator;
1011
use Magento\Framework\View\Result\PageFactory;
1112

@@ -15,7 +16,7 @@
1516
* @SuppressWarnings(PHPMD.LongVariable)
1617
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1718
*/
18-
abstract class Compare extends \Magento\Framework\App\Action\Action
19+
abstract class Compare extends \Magento\Framework\App\Action\Action implements HttpGetActionInterface
1920
{
2021
/**
2122
* Customer id
@@ -139,4 +140,15 @@ public function setCustomerId($customerId)
139140
$this->_customerId = $customerId;
140141
return $this;
141142
}
143+
144+
/**
145+
* @inheritdoc
146+
*/
147+
public function execute()
148+
{
149+
$resultRedirect = $this->resultRedirectFactory->create();
150+
$resultRedirect->setPath('catalog/product_compare');
151+
152+
return $resultRedirect;
153+
}
142154
}

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

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Magento\Catalog\Model\Attribute\ScopeOverriddenValue;
1212
use Magento\Catalog\Model\Locator\LocatorInterface;
1313
use Magento\Catalog\Model\Product;
14+
use Magento\Catalog\Model\Product\Type as ProductType;
1415
use Magento\Catalog\Model\ResourceModel\Eav\Attribute as EavAttribute;
1516
use Magento\Catalog\Model\ResourceModel\Eav\AttributeFactory as EavAttributeFactory;
1617
use Magento\Catalog\Ui\DataProvider\CatalogEavValidationRules;
@@ -419,7 +420,7 @@ public function modifyData(array $data)
419420

420421
foreach ($attributes as $attribute) {
421422
if (null !== ($attributeValue = $this->setupAttributeData($attribute))) {
422-
if ($attribute->getFrontendInput() === 'price' && is_scalar($attributeValue)) {
423+
if ($this->isPriceAttribute($attribute, $attributeValue)) {
423424
$attributeValue = $this->formatPrice($attributeValue);
424425
}
425426
$data[$productId][self::DATA_SOURCE_DEFAULT][$attribute->getAttributeCode()] = $attributeValue;
@@ -430,6 +431,32 @@ public function modifyData(array $data)
430431
return $data;
431432
}
432433

434+
/**
435+
* Obtain if given attribute is a price
436+
*
437+
* @param \Magento\Catalog\Api\Data\ProductAttributeInterface $attribute
438+
* @param string|integer $attributeValue
439+
* @return bool
440+
*/
441+
private function isPriceAttribute(ProductAttributeInterface $attribute, $attributeValue)
442+
{
443+
return $attribute->getFrontendInput() === 'price'
444+
&& is_scalar($attributeValue)
445+
&& !$this->isBundleSpecialPrice($attribute);
446+
}
447+
448+
/**
449+
* Obtain if current product is bundle and given attribute is special_price
450+
*
451+
* @param \Magento\Catalog\Api\Data\ProductAttributeInterface $attribute
452+
* @return bool
453+
*/
454+
private function isBundleSpecialPrice(ProductAttributeInterface $attribute)
455+
{
456+
return $this->locator->getProduct()->getTypeId() === ProductType::TYPE_BUNDLE
457+
&& $attribute->getAttributeCode() === ProductAttributeInterface::CODE_SPECIAL_PRICE;
458+
}
459+
433460
/**
434461
* Resolve data persistence
435462
*

app/code/Magento/PageCache/view/frontend/web/js/page-cache.js

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
define([
77
'jquery',
88
'domReady',
9+
'consoleLogger',
910
'jquery/ui',
1011
'mage/cookies'
11-
], function ($, domReady) {
12+
], function ($, domReady, consoleLogger) {
1213
'use strict';
1314

1415
/**
@@ -35,7 +36,9 @@ define([
3536
* @returns {Array}
3637
*/
3738
$.fn.comments = function () {
38-
var elements = [];
39+
var elements = [],
40+
contents,
41+
elementContents;
3942

4043
/**
4144
* @param {jQuery} element - Comment holder
@@ -46,14 +49,35 @@ define([
4649
// prevent cross origin iframe content reading
4750
if ($(element).prop('tagName') === 'IFRAME') {
4851
iframeHostName = $('<a>').prop('href', $(element).prop('src'))
49-
.prop('hostname');
52+
.prop('hostname');
5053

5154
if (window.location.hostname !== iframeHostName) {
5255
return [];
5356
}
5457
}
5558

56-
$(element).contents().each(function (index, el) {
59+
/**
60+
* Rewrite jQuery contents().
61+
*
62+
* @param {jQuery} elem
63+
*/
64+
contents = function (elem) {
65+
return $.map(elem, function (el) {
66+
try {
67+
return $.nodeName(el, 'iframe') ?
68+
el.contentDocument || (el.contentWindow ? el.contentWindow.document : []) :
69+
$.merge([], el.childNodes);
70+
} catch (e) {
71+
consoleLogger.error(e);
72+
73+
return [];
74+
}
75+
});
76+
};
77+
78+
elementContents = contents($(element));
79+
80+
$.each(elementContents, function (index, el) {
5781
switch (el.nodeType) {
5882
case 1: // ELEMENT_NODE
5983
lookup(el);

app/code/Magento/Review/Model/Review.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
namespace Magento\Review\Model;
77

8+
use Magento\Framework\DataObject;
89
use Magento\Catalog\Model\Product;
910
use Magento\Framework\DataObject\IdentityInterface;
1011
use Magento\Review\Model\ResourceModel\Review\Product\Collection as ProductCollection;
@@ -327,6 +328,9 @@ public function appendSummary($collection)
327328
$item->setRatingSummary($summary);
328329
}
329330
}
331+
if (!$item->getRatingSummary()) {
332+
$item->setRatingSummary(new DataObject());
333+
}
330334
}
331335

332336
return $this;

app/code/Magento/Sales/Block/Order/Items.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
*/
66

77
/**
8-
* Sales order view items block
9-
*
108
* @author Magento Core Team <[email protected]>
119
*/
1210
namespace Magento\Sales\Block\Order;
1311

1412
/**
13+
* Sales order view items block.
14+
*
1515
* @api
1616
* @since 100.0.2
1717
*/
@@ -71,7 +71,6 @@ protected function _prepareLayout()
7171

7272
$this->itemCollection = $this->itemCollectionFactory->create();
7373
$this->itemCollection->setOrderFilter($this->getOrder());
74-
$this->itemCollection->filterByParent(null);
7574

7675
/** @var \Magento\Theme\Block\Html\Pager $pagerBlock */
7776
$pagerBlock = $this->getChildBlock('sales_order_item_pager');
@@ -87,8 +86,9 @@ protected function _prepareLayout()
8786
}
8887

8988
/**
90-
* Determine if the pager should be displayed for order items list
91-
* To be called from templates(after _prepareLayout())
89+
* Determine if the pager should be displayed for order items list.
90+
*
91+
* To be called from templates(after _prepareLayout()).
9292
*
9393
* @return bool
9494
* @since 100.1.7
@@ -101,7 +101,8 @@ public function isPagerDisplayed()
101101

102102
/**
103103
* Get visible items for current page.
104-
* To be called from templates(after _prepareLayout())
104+
*
105+
* To be called from templates(after _prepareLayout()).
105106
*
106107
* @return \Magento\Framework\DataObject[]
107108
* @since 100.1.7
@@ -112,8 +113,9 @@ public function getItems()
112113
}
113114

114115
/**
115-
* Get pager HTML according to our requirements
116-
* To be called from templates(after _prepareLayout())
116+
* Get pager HTML according to our requirements.
117+
*
118+
* To be called from templates(after _prepareLayout()).
117119
*
118120
* @return string HTML output
119121
* @since 100.1.7

app/code/Magento/Ui/view/base/web/js/grid/massactions.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ define([
153153
var itemsType = data.excludeMode ? 'excluded' : 'selected',
154154
selections = {};
155155

156+
if (itemsType === 'excluded' && data.selected && data.selected.length) {
157+
itemsType = 'selected';
158+
data[itemsType] = _.difference(data.selected, data.excluded);
159+
}
160+
156161
selections[itemsType] = data[itemsType];
157162

158163
if (!selections[itemsType].length) {

app/design/frontend/Magento/blank/Magento_Banner/web/css/source/_widgets.less

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// _____________________________________________
99

1010
& when (@media-common = true) {
11-
1211
.block-banners,
1312
.block-banners-inline {
1413
&:extend(.abs-margin-for-blocks-and-widgets);
@@ -22,7 +21,7 @@
2221
}
2322

2423
.banner-item-content {
25-
.lib-css(margin-bottom, @indent__base);
24+
margin-bottom: @indent__base;
2625

2726
img {
2827
display: block;

app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/module/_toolbar.less

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@
44
// */
55

66
//
7-
// Common
8-
// _____________________________________________
7+
// Variables
8+
// ---------------------------------------------
99

1010
@toolbar-mode-icon-font-size: 24px;
1111
@toolbar-element-background: @panel__background-color;
1212

13-
& when (@media-common = true) {
13+
//
14+
// Common
15+
// _____________________________________________
1416

17+
& when (@media-common = true) {
1518
.page-products {
1619
.columns {
1720
position: relative;
@@ -72,12 +75,12 @@
7275
.sorter-action {
7376
vertical-align: top;
7477
.lib-icon-font(
75-
@icon-arrow-up,
76-
@_icon-font-size: 28px,
77-
@_icon-font-line-height: 32px,
78-
@_icon-font-color: @header-icons-color,
79-
@_icon-font-color-hover: @header-icons-color-hover,
80-
@_icon-font-text-hide: true
78+
@icon-arrow-up,
79+
@_icon-font-size: 28px,
80+
@_icon-font-line-height: 32px,
81+
@_icon-font-color: @header-icons-color,
82+
@_icon-font-color-hover: @header-icons-color-hover,
83+
@_icon-font-text-hide: true
8184
);
8285
}
8386

@@ -99,7 +102,7 @@
99102
}
100103

101104
.limiter-label {
102-
font-weight: 400;
105+
font-weight: @font-weight__regular;
103106
}
104107

105108
.limiter {
@@ -176,11 +179,11 @@
176179
}
177180

178181
.lib-icon-font(
179-
@icon-grid,
180-
@_icon-font-size: @toolbar-mode-icon-font-size,
181-
@_icon-font-text-hide: true,
182-
@_icon-font-color: @text__color__muted,
183-
@_icon-font-color-hover: @text__color__muted
182+
@icon-grid,
183+
@_icon-font-size: @toolbar-mode-icon-font-size,
184+
@_icon-font-text-hide: true,
185+
@_icon-font-color: @text__color__muted,
186+
@_icon-font-color-hover: @text__color__muted
184187
);
185188
}
186189

0 commit comments

Comments
 (0)