Skip to content

Commit 5685fce

Browse files
🔃 [EngCom] Public Pull Requests - 2.2-develop
Accepted Public Pull Requests: - #14696: [Backport] Eliminate usage of "else" statements (by @ihor-sviziev) - #14688: Translate Action Label (by @net32) - #14681: [Backport] Fix #13652. Mini cart - fix issue in product title with special chars. (by @ihor-sviziev) - #14678: Checkout page - Fix tooltip position on mobile devices (by @ihor-sviziev) - #14668: Added hyphenation, cutting edge to cutting-edge. (by @surya07081995) - #14629: Refactor Code for Mass Order Unhold (by @AnshuMishra17) - #14635: [Forwardport] #14465 Fix empty changelog tables after MySQL restart. (by @ihor-sviziev) - #13016: Fix for sales PDFs to support all characters (by @rossmc) - #14048: Fix for GitHub issue #14035. (by @kamilszewczyk) Fixed GitHub Issues: - #13652: Issue in product title with special chars in mini cart (reported by @Sunil-Nethues) has been fixed in #14681 by @ihor-sviziev in 2.2-develop branch Related commits: 1. 8a30ffd - #14465: [Indexes] Product 'version_id' lost last 'auro_increment' value after MySQL restart. (reported by @swnsma) has been fixed in #14635 by @ihor-sviziev in 2.2-develop branch Related commits: 1. 17b585f - #9666: Magento 2.1.6 - Invoice PDF doesn't support Thai (reported by @jsdupuis) has been fixed in #13016 by @rossmc in 2.2-develop branch Related commits: 1. e44c91f 2. b38976b 3. a5b685e - #12323: Magento 2.1.3 - Invoice and shipment PDF doesn't support Arabic (reported by @Avinashsain) has been fixed in #13016 by @rossmc in 2.2-develop branch Related commits: 1. e44c91f 2. b38976b 3. a5b685e - #14035: Magento REST API, wrong condition for product list category filter (reported by @kamilszewczyk) has been fixed in #14048 by @kamilszewczyk in 2.2-develop branch Related commits: 1. 3e776ee 2. e180558
2 parents f378f1f + e4f85c9 commit 5685fce

File tree

34 files changed

+98
-73
lines changed

34 files changed

+98
-73
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/magento/magento2?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
44
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/magento-2/localized.png)](https://crowdin.com/project/magento-2)
55
<h2>Welcome</h2>
6-
Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a cutting edge, feature-rich eCommerce solution that gets results.
6+
Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a cutting-edge, feature-rich eCommerce solution that gets results.
77

88
## Magento system requirements
99
[Magento system requirements](http://devdocs.magento.com/guides/v2.2/install-gde/system-requirements2.html)

app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Radio.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ public function getCondition()
3131
{
3232
if ($this->getValue()) {
3333
return $this->getColumn()->getValue();
34-
} else {
35-
return [['neq' => $this->getColumn()->getValue()], ['is' => new \Zend_Db_Expr('NULL')]];
3634
}
35+
return [['neq' => $this->getColumn()->getValue()], ['is' => new \Zend_Db_Expr('NULL')]];
3736
}
3837
}

app/code/Magento/Backend/Block/Widget/Grid/Massaction/AbstractMassaction.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,8 @@ public function getSelectedJson()
222222
if ($selected = $this->getRequest()->getParam($this->getFormFieldNameInternal())) {
223223
$selected = explode(',', $selected);
224224
return join(',', $selected);
225-
} else {
226-
return '';
227225
}
226+
return '';
228227
}
229228

230229
/**
@@ -237,9 +236,8 @@ public function getSelected()
237236
if ($selected = $this->getRequest()->getParam($this->getFormFieldNameInternal())) {
238237
$selected = explode(',', $selected);
239238
return $selected;
240-
} else {
241-
return [];
242239
}
240+
return [];
243241
}
244242

245243
/**

app/code/Magento/Backend/Block/Widget/Grid/Massaction/Extended.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,8 @@ public function getSelectedJson()
218218
if ($selected = $this->getRequest()->getParam($this->getFormFieldNameInternal())) {
219219
$selected = explode(',', $selected);
220220
return join(',', $selected);
221-
} else {
222-
return '';
223221
}
222+
return '';
224223
}
225224

226225
/**
@@ -233,9 +232,8 @@ public function getSelected()
233232
if ($selected = $this->getRequest()->getParam($this->getFormFieldNameInternal())) {
234233
$selected = explode(',', $selected);
235234
return $selected;
236-
} else {
237-
return [];
238235
}
236+
return [];
239237
}
240238

241239
/**

app/code/Magento/Backend/Controller/Adminhtml/Auth/Login.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,8 @@ public function execute()
5050
// redirect according to rewrite rule
5151
if ($requestUrl != $backendUrl) {
5252
return $this->getRedirect($backendUrl);
53-
} else {
54-
return $this->resultPageFactory->create();
5553
}
54+
return $this->resultPageFactory->create();
5655
}
5756

5857
/**

app/code/Magento/Backend/Controller/Adminhtml/System/Account/Save.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@ private function getSecurityCookie()
3232
{
3333
if (!($this->securityCookie instanceof SecurityCookie)) {
3434
return \Magento\Framework\App\ObjectManager::getInstance()->get(SecurityCookie::class);
35-
} else {
36-
return $this->securityCookie;
3735
}
36+
return $this->securityCookie;
3837
}
3938

4039
/**

app/code/Magento/Backend/Model/Menu/Item.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,12 +503,11 @@ public function populateFromArray(array $data)
503503
$this->_tooltip = $this->_getArgument($data, 'toolTip');
504504
$this->_title = $this->_getArgument($data, 'title');
505505
$this->target = $this->_getArgument($data, 'target');
506+
$this->_submenu = null;
506507
if (isset($data['sub_menu'])) {
507508
$menu = $this->_menuFactory->create();
508509
$menu->populateFromArray($data['sub_menu']);
509510
$this->_submenu = $menu;
510-
} else {
511-
$this->_submenu = null;
512511
}
513512
}
514513
}

app/code/Magento/Braintree/Test/Unit/Model/Report/BraintreeTransactionStub.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@ public function __get($name)
3434
{
3535
if (array_key_exists($name, $this->_attributes)) {
3636
return $this->_attributes[$name];
37-
} else {
38-
trigger_error('Undefined property on ' . get_class($this) . ': ' . $name, E_USER_NOTICE);
39-
return null;
4037
}
38+
trigger_error('Undefined property on ' . get_class($this) . ': ' . $name, E_USER_NOTICE);
39+
return null;
4140
}
4241

4342
/**

app/code/Magento/Bundle/Block/Adminhtml/Sales/Order/Items/Renderer.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,8 @@ public function getChildren($item)
9595

9696
if (isset($itemsArray[$item->getOrderItem()->getId()])) {
9797
return $itemsArray[$item->getOrderItem()->getId()];
98-
} else {
99-
return null;
10098
}
99+
return null;
101100
}
102101

103102
/**
@@ -219,9 +218,8 @@ public function getOrderItem()
219218
{
220219
if ($this->getItem() instanceof \Magento\Sales\Model\Order\Item) {
221220
return $this->getItem();
222-
} else {
223-
return $this->getItem()->getOrderItem();
224221
}
222+
return $this->getItem()->getOrderItem();
225223
}
226224

227225
/**

app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,8 @@ public function isSelected($selection)
191191
return in_array($selection->getSelectionId(), $selectedOptions);
192192
} elseif ($selectedOptions == 'None') {
193193
return false;
194-
} else {
195-
return $selection->getIsDefault() && $selection->isSaleable();
196194
}
195+
return $selection->getIsDefault() && $selection->isSaleable();
197196
}
198197

199198
/**

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,8 @@ public function getValueHtml($item)
142142
if ($attributes = $this->getSelectionAttributes($item)) {
143143
return sprintf('%d', $attributes['qty']) . ' x ' . $this->escapeHtml($item->getName()) . " "
144144
. $this->getOrder()->formatPrice($attributes['price']);
145-
} else {
146-
return $this->escapeHtml($item->getName());
147145
}
146+
return $this->escapeHtml($item->getName());
148147
}
149148

150149
/**
@@ -179,9 +178,8 @@ public function getChildren($item)
179178

180179
if (isset($itemsArray[$item->getOrderItem()->getId()])) {
181180
return $itemsArray[$item->getOrderItem()->getId()];
182-
} else {
183-
return null;
184181
}
182+
return null;
185183
}
186184

187185
/**

app/code/Magento/Bundle/Model/Plugin/PriceBackend.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ public function aroundValidate(
2929
&& $object->getPriceType() == \Magento\Bundle\Model\Product\Price::PRICE_TYPE_DYNAMIC
3030
) {
3131
return true;
32-
} else {
33-
return $proceed($object);
3432
}
33+
return $proceed($object);
3534
}
3635
}

app/code/Magento/Bundle/Model/Product/Type.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,9 +1015,8 @@ public function shakeSelections($firstItem, $secondItem)
10151015
];
10161016
if ($aPosition == $bPosition) {
10171017
return 0;
1018-
} else {
1019-
return $aPosition < $bPosition ? -1 : 1;
10201018
}
1019+
return $aPosition < $bPosition ? -1 : 1;
10211020
}
10221021

10231022
/**

app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/AbstractItems.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,8 @@ public function getChildren($item)
9292

9393
if (isset($itemsArray[$item->getOrderItem()->getId()])) {
9494
return $itemsArray[$item->getOrderItem()->getId()];
95-
} else {
96-
return null;
9795
}
96+
return null;
9897
}
9998

10099
/**
@@ -244,9 +243,8 @@ public function getOrderItem()
244243
{
245244
if ($this->getItem() instanceof \Magento\Sales\Model\Order\Item) {
246245
return $this->getItem();
247-
} else {
248-
return $this->getItem()->getOrderItem();
249246
}
247+
return $this->getItem()->getOrderItem();
250248
}
251249

252250
/**

app/code/Magento/Bundle/Pricing/Adjustment/Calculator.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,8 @@ public function calculateBundleAmount($basePriceValue, $bundleProduct, $selectio
271271
{
272272
if ($bundleProduct->getPriceType() == Price::PRICE_TYPE_FIXED) {
273273
return $this->calculateFixedBundleAmount($basePriceValue, $bundleProduct, $selectionPriceList, $exclude);
274-
} else {
275-
return $this->calculateDynamicBundleAmount($basePriceValue, $bundleProduct, $selectionPriceList, $exclude);
276274
}
275+
return $this->calculateDynamicBundleAmount($basePriceValue, $bundleProduct, $selectionPriceList, $exclude);
277276
}
278277

279278
/**

app/code/Magento/Bundle/Pricing/Price/BundleSelectionPrice.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,7 @@ public function getProduct()
184184
{
185185
if ($this->bundleProduct->getPriceType() == Price::PRICE_TYPE_DYNAMIC) {
186186
return parent::getProduct();
187-
} else {
188-
return $this->bundleProduct;
189187
}
188+
return $this->bundleProduct;
190189
}
191190
}

app/code/Magento/Bundle/Pricing/Price/ConfiguredPrice.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,8 @@ public function getValue()
144144
$this->priceInfo
145145
->getPrice(BundleDiscountPrice::PRICE_CODE)
146146
->calculateDiscount($configuredOptionsAmount);
147-
} else {
148-
return parent::getValue();
149147
}
148+
return parent::getValue();
150149
}
151150

152151
/**

app/code/Magento/Catalog/Model/Api/SearchCriteria/CollectionProcessor/FilterProcessor/ProductCategoryFilter.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,14 @@ class ProductCategoryFilter implements CustomFilterInterface
2121
*/
2222
public function apply(Filter $filter, AbstractDb $collection)
2323
{
24-
$conditionType = $filter->getConditionType() ?: 'eq';
25-
$categoryFilter = [$conditionType => [$filter->getValue()]];
24+
$value = $filter->getValue();
25+
$conditionType = $filter->getConditionType() ?: 'in';
26+
if (($conditionType === 'in' || $conditionType === 'nin') && is_string($value)) {
27+
$value = explode(',', $value);
28+
} else {
29+
$value = [$value];
30+
}
31+
$categoryFilter = [$conditionType => $value];
2632

2733
/** @var Collection $collection */
2834
$collection->addCategoriesFilter($categoryFilter);

app/code/Magento/Catalog/Test/Unit/Model/Api/SearchCriteria/CollectionProcessor/FilterProcessor/ProductCategoryFilterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function testApplyWithoutCondition()
6666

6767
$collectionMock->expects($this->once())
6868
->method('addCategoriesFilter')
69-
->with(['eq' => ['value']]);
69+
->with(['in' => ['value']]);
7070

7171
$this->assertTrue($this->model->apply($filterMock, $collectionMock));
7272
}

app/code/Magento/Checkout/CustomerData/DefaultItem.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
namespace Magento\Checkout\CustomerData;
88

9+
use Magento\Framework\App\ObjectManager;
10+
911
/**
1012
* Default item
1113
*/
@@ -36,26 +38,36 @@ class DefaultItem extends AbstractItem
3638
*/
3739
protected $checkoutHelper;
3840

41+
/**
42+
* Escaper
43+
*
44+
* @var \Magento\Framework\Escaper
45+
*/
46+
private $escaper;
47+
3948
/**
4049
* @param \Magento\Catalog\Helper\Image $imageHelper
4150
* @param \Magento\Msrp\Helper\Data $msrpHelper
4251
* @param \Magento\Framework\UrlInterface $urlBuilder
4352
* @param \Magento\Catalog\Helper\Product\ConfigurationPool $configurationPool
4453
* @param \Magento\Checkout\Helper\Data $checkoutHelper
54+
* @param \Magento\Framework\Escaper|null $escaper
4555
* @codeCoverageIgnore
4656
*/
4757
public function __construct(
4858
\Magento\Catalog\Helper\Image $imageHelper,
4959
\Magento\Msrp\Helper\Data $msrpHelper,
5060
\Magento\Framework\UrlInterface $urlBuilder,
5161
\Magento\Catalog\Helper\Product\ConfigurationPool $configurationPool,
52-
\Magento\Checkout\Helper\Data $checkoutHelper
62+
\Magento\Checkout\Helper\Data $checkoutHelper,
63+
\Magento\Framework\Escaper $escaper = null
5364
) {
5465
$this->configurationPool = $configurationPool;
5566
$this->imageHelper = $imageHelper;
5667
$this->msrpHelper = $msrpHelper;
5768
$this->urlBuilder = $urlBuilder;
5869
$this->checkoutHelper = $checkoutHelper;
70+
$this->escaper = $escaper ?: ObjectManager::getInstance()->get(\Magento\Framework\Escaper::class);
5971
}
6072

6173
/**
@@ -64,14 +76,16 @@ public function __construct(
6476
protected function doGetItemData()
6577
{
6678
$imageHelper = $this->imageHelper->init($this->getProductForThumbnail(), 'mini_cart_product_thumbnail');
79+
$productName = $this->escaper->escapeHtml($this->item->getProduct()->getName());
80+
6781
return [
6882
'options' => $this->getOptionList(),
6983
'qty' => $this->item->getQty() * 1,
7084
'item_id' => $this->item->getId(),
7185
'configure_url' => $this->getConfigureUrl(),
7286
'is_visible_in_site_visibility' => $this->item->getProduct()->isVisibleInSiteVisibility(),
7387
'product_id' => $this->item->getProduct()->getId(),
74-
'product_name' => $this->item->getProduct()->getName(),
88+
'product_name' => $productName,
7589
'product_sku' => $this->item->getProduct()->getSku(),
7690
'product_url' => $this->getProductUrl(),
7791
'product_has_url' => $this->hasProductUrl(),

app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<div class="product-item-details">
2525
<strong class="product-item-name">
2626
<!-- ko if: product_has_url -->
27-
<a data-bind="attr: {href: product_url}, text: product_name"></a>
27+
<a data-bind="attr: {href: product_url}, html: product_name"></a>
2828
<!-- /ko -->
2929
<!-- ko ifnot: product_has_url -->
3030
<!-- ko text: product_name --><!-- /ko -->

app/code/Magento/Config/view/adminhtml/templates/system/config/form/field/array.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ $_colspan = $block->isAddAfter() ? 2 : 1;
2121
<?php foreach ($block->getColumns() as $columnName => $column): ?>
2222
<th><?= /* @escapeNotVerified */ $column['label'] ?></th>
2323
<?php endforeach;?>
24-
<th class="col-actions" colspan="<?= /* @escapeNotVerified */ $_colspan ?>">Action</th>
24+
<th class="col-actions" colspan="<?= /* @escapeNotVerified */ $_colspan ?>"><?= /* @escapeNotVerified */ __('Action') ?></th>
2525
</tr>
2626
</thead>
2727
<tfoot>

app/code/Magento/ConfigurableProduct/CustomerData/ConfigurableItem.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,24 @@ class ConfigurableItem extends DefaultItem
2626
* @param \Magento\Catalog\Helper\Product\ConfigurationPool $configurationPool
2727
* @param \Magento\Checkout\Helper\Data $checkoutHelper
2828
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
29+
* @param \Magento\Framework\Escaper|null $escaper
2930
*/
3031
public function __construct(
3132
\Magento\Catalog\Helper\Image $imageHelper,
3233
\Magento\Msrp\Helper\Data $msrpHelper,
3334
\Magento\Framework\UrlInterface $urlBuilder,
3435
\Magento\Catalog\Helper\Product\ConfigurationPool $configurationPool,
3536
\Magento\Checkout\Helper\Data $checkoutHelper,
36-
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
37+
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
38+
\Magento\Framework\Escaper $escaper = null
3739
) {
3840
parent::__construct(
3941
$imageHelper,
4042
$msrpHelper,
4143
$urlBuilder,
4244
$configurationPool,
43-
$checkoutHelper
45+
$checkoutHelper,
46+
$escaper
4447
);
4548
$this->_scopeConfig = $scopeConfig;
4649
}

0 commit comments

Comments
 (0)