Skip to content

Commit 951e467

Browse files
committed
Merge branch '2.2-develop' of https://github.com/magento/magento2ce into MAGETWO-80811
# Conflicts: # composer.json # composer.lock
2 parents 2315168 + 921d5f6 commit 951e467

File tree

226 files changed

+16891
-150
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

226 files changed

+16891
-150
lines changed

app/code/Magento/Backend/Controller/Adminhtml/Noroute/Index.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88

99
class Index extends \Magento\Backend\App\Action
1010
{
11+
/**
12+
* Array of actions which can be processed without secret key validation
13+
*
14+
* @var string[]
15+
*/
16+
protected $_publicActions = ['index'];
17+
1118
/**
1219
* @var \Magento\Framework\View\Result\PageFactory
1320
*/

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/Catalog/view/frontend/templates/product/view/attribute.phtml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ $_attributeLabel = $block->getAtLabel();
2222
$_attributeType = $block->getAtType();
2323
$_attributeAddAttribute = $block->getAddAttribute();
2424

25+
$renderLabel = true;
26+
// if defined as 'none' in layout, do not render
27+
if ($_attributeLabel == 'none') {
28+
$renderLabel = false;
29+
}
30+
2531
if ($_attributeLabel && $_attributeLabel == 'default') {
2632
$_attributeLabel = $_product->getResource()->getAttribute($_code)->getStoreLabel();
2733
}
@@ -31,10 +37,9 @@ if ($_attributeType && $_attributeType == 'text') {
3137
$_attributeValue = $_helper->productAttribute($_product, $_product->$_call(), $_code);
3238
}
3339
?>
34-
3540
<?php if ($_attributeValue): ?>
3641
<div class="product attribute <?= /* @escapeNotVerified */ $_className ?>">
37-
<?php if ($_attributeLabel != 'none'): ?><strong class="type"><?= /* @escapeNotVerified */ $_attributeLabel ?></strong><?php endif; ?>
42+
<?php if ($renderLabel): ?><strong class="type"><?= /* @escapeNotVerified */ $_attributeLabel ?></strong><?php endif; ?>
3843
<div class="value" <?= /* @escapeNotVerified */ $_attributeAddAttribute ?>><?= /* @escapeNotVerified */ $_attributeValue ?></div>
3944
</div>
4045
<?php endif; ?>

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/Model/ResourceModel/Block/Collection.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,20 @@ class Collection extends AbstractCollection
1818
*/
1919
protected $_idFieldName = 'block_id';
2020

21+
/**
22+
* Event prefix
23+
*
24+
* @var string
25+
*/
26+
protected $_eventPrefix = 'cms_block_collection';
27+
28+
/**
29+
* Event object
30+
*
31+
* @var string
32+
*/
33+
protected $_eventObject = 'block_collection';
34+
2135
/**
2236
* Perform operations after collection load
2337
*

app/code/Magento/Cms/Model/ResourceModel/Page/Collection.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,20 @@ class Collection extends AbstractCollection
2525
*/
2626
protected $_previewFlag;
2727

28+
/**
29+
* Event prefix
30+
*
31+
* @var string
32+
*/
33+
protected $_eventPrefix = 'cms_page_collection';
34+
35+
/**
36+
* Event object
37+
*
38+
* @var string
39+
*/
40+
protected $_eventObject = 'page_collection';
41+
2842
/**
2943
* Define resource model
3044
*

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));

0 commit comments

Comments
 (0)