Skip to content

Commit 268dce1

Browse files
author
Oleksii Korshenko
authored
Merge pull request #1546 from magento-engcom/2.2-develop-prs
Public Pull Requests: #11200 #11147 #11154 #11160 #11138 #11127 #11048 #11049 #11069 #11084
2 parents 11a29d7 + 30003ae commit 268dce1

File tree

16 files changed

+86
-29
lines changed

16 files changed

+86
-29
lines changed

app/code/Magento/Catalog/Block/Category/Plugin/PriceBoxTags.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ private function getTaxRateIds(PriceBox $subject)
102102

103103
if (!empty($billingAddress) || !empty($shippingAddress)) {
104104
$rateRequest = $this->getTaxCalculation()->getRateRequest(
105-
$billingAddress,
106105
$shippingAddress,
106+
$billingAddress,
107107
$customerTaxClassId,
108108
$this->scopeResolver->getScope()->getId(),
109109
$this->customerSession->getCustomerId()

app/code/Magento/Catalog/Model/Product/Gallery/UpdateHandler.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ protected function processDeletedImages($product, array &$images)
3333
if (!empty($image['removed'])) {
3434
if (!empty($image['value_id']) && !isset($picturesInOtherStores[$image['file']])) {
3535
$recordsToDelete[] = $image['value_id'];
36-
// only delete physical files if they are not used by any other products
37-
if (!$this->resourceModel->countImageUses($image['file']) > 1) {
36+
$catalogPath = $this->mediaConfig->getBaseMediaPath();
37+
$isFile = $this->mediaDirectory->isFile($catalogPath . $image['file']);
38+
// only delete physical files if they are not used by any other products and if this file exists
39+
if (!($this->resourceModel->countImageUses($image['file']) > 1) && $isFile) {
3840
$filesToDelete[] = ltrim($image['file'], '/');
3941
}
4042
}

app/code/Magento/Catalog/Test/Unit/Block/Category/Plugin/PriceBoxTagsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ public function testAfterGetCacheKey()
119119
$this->session->expects($this->once())->method('getCustomerId')->willReturn($customerId);
120120
$rateRequest = $this->getMockBuilder(\Magento\Framework\DataObject::class)->getMock();
121121
$this->taxCalculation->expects($this->once())->method('getRateRequest')->with(
122-
new \Magento\Framework\DataObject($billingAddress),
123122
new \Magento\Framework\DataObject($shippingAddress),
123+
new \Magento\Framework\DataObject($billingAddress),
124124
$customerTaxClassId,
125125
$scopeId,
126126
$customerId

app/code/Magento/CatalogImportExport/Model/Import/Product/CategoryProcessor.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,12 @@ protected function createCategory($name, $parentId)
118118
$category->setIsActive(true);
119119
$category->setIncludeInMenu(true);
120120
$category->setAttributeSetId($category->getDefaultAttributeSetId());
121-
$category->save();
122-
$this->categoriesCache[$category->getId()] = $category;
121+
try {
122+
$category->save();
123+
$this->categoriesCache[$category->getId()] = $category;
124+
} catch (\Exception $e) {
125+
$this->addFailedCategory($category, $e);
126+
}
123127

124128
return $category->getId();
125129
}

app/code/Magento/Cms/Helper/Wysiwyg/Images.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,14 @@ public function getImageHtmlDeclaration($filename, $renderAsTag = false)
177177
$html = $fileurl; // $mediaPath;
178178
} else {
179179
$directive = $this->urlEncoder->encode($directive);
180-
$html = $this->_backendData->getUrl('cms/wysiwyg/directive', ['___directive' => $directive]);
180+
181+
$html = $this->_backendData->getUrl(
182+
'cms/wysiwyg/directive',
183+
[
184+
'___directive' => $directive,
185+
'_escape_params' => false,
186+
]
187+
);
181188
}
182189
}
183190
return $html;

app/code/Magento/Cms/Test/Unit/Helper/Wysiwyg/ImagesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ public function testGetImageHtmlDeclaration($baseUrl, $fileName, $isUsingStaticU
450450

451451
$this->backendDataMock->expects($this->any())
452452
->method('getUrl')
453-
->with('cms/wysiwyg/directive', ['___directive' => $directive])
453+
->with('cms/wysiwyg/directive', ['___directive' => $directive, '_escape_params' => false])
454454
->willReturn($directive);
455455

456456
$this->assertEquals($expectedHtml, $this->imagesHelper->getImageHtmlDeclaration($fileName));

app/code/Magento/Review/i18n/en_US.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,4 @@ Summary,Summary
132132
"Allow Guests to Write Reviews","Allow Guests to Write Reviews"
133133
Active,Active
134134
Inactive,Inactive
135+
"Please select one of each of the ratings above.","Please select one of each of the ratings above."

app/code/Magento/Review/view/frontend/templates/form.phtml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
id="<?= $block->escapeHtmlAttr($_rating->getRatingCode()) ?>_<?= $block->escapeHtmlAttr($_option->getValue()) ?>"
3636
value="<?= $block->escapeHtmlAttr($_option->getId()) ?>"
3737
class="radio"
38-
data-validate="{required:true, messages:{required:'Please select one of each of the ratings above.'}}"
38+
data-validate="{ 'rating-required':true}"
3939
aria-labelledby="<?= $block->escapeHtmlAttr($_rating->getRatingCode()) ?>_rating_label <?= $block->escapeHtmlAttr($_rating->getRatingCode()) ?>_<?= $block->escapeHtmlAttr($_option->getValue()) ?>_label" />
4040
<label
4141
class="rating-<?= $block->escapeHtmlAttr($iterator) ?>"
@@ -85,7 +85,8 @@
8585
"Magento_Ui/js/core/app": <?= /* @noEscape */ $block->getJsLayout() ?>
8686
},
8787
"#review-form": {
88-
"Magento_Review/js/error-placement": {}
88+
"Magento_Review/js/error-placement": {},
89+
"Magento_Review/js/validate-review": {}
8990
}
9091
}
9192
</script>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
define([
7+
'jquery',
8+
'jquery/ui',
9+
'jquery/validate',
10+
'mage/translate'
11+
], function ($) {
12+
'use strict';
13+
14+
$.validator.addMethod(
15+
'rating-required', function (value) {
16+
return value !== undefined;
17+
}, $.mage.__('Please select one of each of the ratings above.'));
18+
});

app/code/Magento/Sales/Model/Order/Shipment/ItemCreation.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public function getOrderItemId()
4343
public function setOrderItemId($orderItemId)
4444
{
4545
$this->orderItemId = $orderItemId;
46+
return $this;
4647
}
4748

4849
/**
@@ -59,6 +60,7 @@ public function getQty()
5960
public function setQty($qty)
6061
{
6162
$this->qty = $qty;
63+
return $this;
6264
}
6365

6466
/**

0 commit comments

Comments
 (0)