Skip to content

Commit c0b6034

Browse files
Merge branch '2.2-develop' of github.com:magento/magento2ce into 12468
2 parents d518838 + d865ef1 commit c0b6034

File tree

896 files changed

+25952
-1131
lines changed

Some content is hidden

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

896 files changed

+25952
-1131
lines changed

app/code/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricing.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ protected function saveAndReplaceAdvancedPrices()
394394
? $rowData[self::COL_TIER_PRICE] : 0,
395395
'percentage_value' => $rowData[self::COL_TIER_PRICE_TYPE] === self::TIER_PRICE_TYPE_PERCENT
396396
? $rowData[self::COL_TIER_PRICE] : null,
397-
'website_id' => $this->getWebsiteId($rowData[self::COL_TIER_PRICE_WEBSITE])
397+
'website_id' => $this->getWebSiteId($rowData[self::COL_TIER_PRICE_WEBSITE])
398398
];
399399
}
400400
}

app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricing/Validator/WebsiteTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class WebsiteTest extends \PHPUnit\Framework\TestCase
2727

2828
protected function setUp()
2929
{
30-
$this->webSiteModel = $this->getMockBuilder(\Magento\Store\Model\WebSite::class)
30+
$this->webSiteModel = $this->getMockBuilder(\Magento\Store\Model\Website::class)
3131
->setMethods(['getBaseCurrency'])
3232
->disableOriginalConstructor()
3333
->getMock();

app/code/Magento/Analytics/etc/di.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,4 +254,22 @@
254254
<argument name="responseResolver" xsi:type="object">NotifyDataChangedResponseResolver</argument>
255255
</arguments>
256256
</type>
257+
<type name="Magento\Config\Model\Config\TypePool">
258+
<arguments>
259+
<argument name="sensitive" xsi:type="array">
260+
<item name="analytics/url/signup" xsi:type="string">1</item>
261+
<item name="analytics/url/update" xsi:type="string">1</item>
262+
<item name="analytics/url/bi_essentials" xsi:type="string">1</item>
263+
<item name="analytics/url/otp" xsi:type="string">1</item>
264+
<item name="analytics/url/report" xsi:type="string">1</item>
265+
<item name="analytics/url/notify_data_changed" xsi:type="string">1</item>
266+
<item name="analytics/general/token" xsi:type="string">1</item>
267+
</argument>
268+
<argument name="environment" xsi:type="array">
269+
<item name="crontab/default/jobs/analytics_collect_data/schedule/cron_expr" xsi:type="string">1</item>
270+
<item name="crontab/default/jobs/analytics_update/schedule/cron_expr" xsi:type="string">1</item>
271+
<item name="crontab/default/jobs/analytics_subscribe/schedule/cron_expr" xsi:type="string">1</item>
272+
</argument>
273+
</arguments>
274+
</type>
257275
</config>

app/code/Magento/Backend/Block/System/Store/Edit/AbstractForm.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ protected function _prepareForm()
3737
['data' => ['id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post']]
3838
);
3939

40-
$this->_prepareStoreFieldSet($form);
40+
$this->_prepareStoreFieldset($form);
4141

4242
$form->addField(
4343
'store_type',

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ public function execute()
5454
$user = $this->_objectManager->create(\Magento\User\Model\User::class)->load($userId);
5555

5656
$user->setId($userId)
57-
->setUsername($this->getRequest()->getParam('username', false))
58-
->setFirstname($this->getRequest()->getParam('firstname', false))
59-
->setLastname($this->getRequest()->getParam('lastname', false))
57+
->setUserName($this->getRequest()->getParam('username', false))
58+
->setFirstName($this->getRequest()->getParam('firstname', false))
59+
->setLastName($this->getRequest()->getParam('lastname', false))
6060
->setEmail(strtolower($this->getRequest()->getParam('email', false)));
6161

6262
if ($this->_objectManager->get(\Magento\Framework\Validator\Locale::class)->isValid($interfaceLocale)) {

app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/ColumnSetTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public function testSetFilterTypePropagatesFilterTypeToColumns()
117117

118118
public function testGetRowUrlIfUrlPathNotSet()
119119
{
120-
$this->assertEquals('#', $this->_block->getRowUrl(new \StdClass()));
120+
$this->assertEquals('#', $this->_block->getRowUrl(new \stdClass()));
121121
}
122122

123123
public function testGetRowUrl()

app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/ColumnTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ public function testSetGetGrid()
351351

352352
$this->_block->setFilter('StdClass');
353353

354-
$grid = new \StdClass();
354+
$grid = new \stdClass();
355355
$this->_block->setGrid($grid);
356356
$this->assertEquals($grid, $this->_block->getGrid());
357357
}

app/code/Magento/Backend/Test/Unit/Model/Config/SessionLifetime/BackendModelTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ public function testBeforeSave($value, $errorMessage = null)
2020
\Magento\Backend\Model\Config\SessionLifetime\BackendModel::class
2121
);
2222
if ($errorMessage !== null) {
23-
$this->expectException(\Magento\Framework\Exception\LocalizedException::class, $errorMessage);
23+
$this->expectException(\Magento\Framework\Exception\LocalizedException::class);
24+
$this->expectExceptionMessage($errorMessage);
2425
}
2526
$model->setValue($value);
2627
$object = $model->beforeSave();

app/code/Magento/Backend/etc/adminhtml/di.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@
145145
<item name="dev" xsi:type="const">Magento\Config\Model\Config\Structure\ElementVisibilityInterface::HIDDEN</item>
146146
<item name="general/locale/code" xsi:type="const">Magento\Config\Model\Config\Structure\ElementVisibilityInterface::DISABLED</item>
147147
</argument>
148+
<argument name="exemptions" xsi:type="array">
149+
<item name="dev/debug/debug_logging" xsi:type="string"/>
150+
</argument>
148151
</arguments>
149152
</type>
150153
<type name="Magento\Framework\View\Layout\Generator\Block">

app/code/Magento/Backend/view/adminhtml/templates/page/header.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
data-mage-init='{"dropdown":{}}'
3030
data-toggle="dropdown">
3131
<span class="admin__action-dropdown-text">
32-
<span class="admin-user-account-text"><?= $block->escapeHtml($block->getUser()->getUsername()) ?></span>
32+
<span class="admin-user-account-text"><?= $block->escapeHtml($block->getUser()->getUserName()) ?></span>
3333
</span>
3434
</a>
3535
<ul class="admin__action-dropdown-menu">
@@ -39,7 +39,7 @@
3939
href="<?= /* @escapeNotVerified */ $block->getUrl('adminhtml/system_account/index') ?>"
4040
<?= /* @escapeNotVerified */ $block->getUiId('user', 'account', 'settings') ?>
4141
title="<?= $block->escapeHtml(__('Account Setting')) ?>">
42-
<?= /* @escapeNotVerified */ __('Account Setting') ?> (<span class="admin-user-name"><?= $block->escapeHtml($block->getUser()->getUsername()) ?></span>)
42+
<?= /* @escapeNotVerified */ __('Account Setting') ?> (<span class="admin-user-name"><?= $block->escapeHtml($block->getUser()->getUserName()) ?></span>)
4343
</a>
4444
</li>
4545
<?php endif; ?>

app/code/Magento/Backend/view/adminhtml/templates/system/search.phtml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@
2828
<script data-template="search-suggest" type="text/x-magento-template">
2929
<ul class="search-global-menu">
3030
<li class="item">
31-
<a id="searchPreviewProducts" href="<?= /* @escapeNotVerified */ $block->getURL('catalog/product/index/') ?>?search=<%- data.term%>" class="title">"<%- data.term%>" in Products</a>
31+
<a id="searchPreviewProducts" href="<?= /* @escapeNotVerified */ $block->getUrl('catalog/product/index/') ?>?search=<%- data.term%>" class="title">"<%- data.term%>" in Products</a>
3232
</li>
3333
<li class="item">
34-
<a id="searchPreviewOrders" href="<?= /* @escapeNotVerified */ $block->getURL('sales/order/index/') ?>?search=<%- data.term%>" class="title">"<%- data.term%>" in Orders</a>
34+
<a id="searchPreviewOrders" href="<?= /* @escapeNotVerified */ $block->getUrl('sales/order/index/') ?>?search=<%- data.term%>" class="title">"<%- data.term%>" in Orders</a>
3535
</li>
3636
<li class="item">
37-
<a id="searchPreviewCustomers" href="<?= /* @escapeNotVerified */ $block->getURL('customer/index/index/') ?>?search=<%- data.term%>" class="title">"<%- data.term%>" in Customers</a>
37+
<a id="searchPreviewCustomers" href="<?= /* @escapeNotVerified */ $block->getUrl('customer/index/index/') ?>?search=<%- data.term%>" class="title">"<%- data.term%>" in Customers</a>
3838
</li>
3939
<li class="item">
40-
<a id="searchPreviewPages" href="<?= /* @escapeNotVerified */ $block->getURL('cms/page/index/') ?>?search=<%- data.term%>" class="title">"<%- data.term%>" in Pages</a>
40+
<a id="searchPreviewPages" href="<?= /* @escapeNotVerified */ $block->getUrl('cms/page/index/') ?>?search=<%- data.term%>" class="title">"<%- data.term%>" in Pages</a>
4141
</li>
4242
<% if (data.items.length) { %>
4343
<% _.each(data.items, function(value){ %>

app/code/Magento/Backend/view/adminhtml/templates/widget/grid/extended.phtml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ $numColumns = sizeof($block->getColumns());
7272
<?php if ($block->getPagerVisibility()): ?>
7373
<div class="admin__data-grid-pager-wrap">
7474
<select name="<?= /* @escapeNotVerified */ $block->getVarNameLimit() ?>"
75-
id="<?= $block->escapeHTML($block->getHtmlId()) ?>_page-limit"
75+
id="<?= $block->escapeHtml($block->getHtmlId()) ?>_page-limit"
7676
onchange="<?= /* @escapeNotVerified */ $block->getJsObjectName() ?>.loadByElement(this)"
7777
class="admin__control-select">
7878
<option value="20"<?php if ($block->getCollection()->getPageSize() == 20): ?>
@@ -91,7 +91,7 @@ $numColumns = sizeof($block->getColumns());
9191
selected="selected"<?php endif; ?>>200
9292
</option>
9393
</select>
94-
<label for="<?= $block->escapeHTML($block->getHtmlId()) ?><?= $block->escapeHTML($block->getHtmlId()) ?>_page-limit"
94+
<label for="<?= $block->escapeHtml($block->getHtmlId()) ?><?= $block->escapeHtml($block->getHtmlId()) ?>_page-limit"
9595
class="admin__control-support-text"><?= /* @escapeNotVerified */ __('per page') ?></label>
9696

9797
<div class="admin__data-grid-pager">
@@ -107,12 +107,12 @@ $numColumns = sizeof($block->getColumns());
107107
<button type="button" class="action-previous disabled"><span><?= /* @escapeNotVerified */ __('Previous page') ?></span></button>
108108
<?php endif; ?>
109109
<input type="text"
110-
id="<?= $block->escapeHTML($block->getHtmlId()) ?>_page-current"
110+
id="<?= $block->escapeHtml($block->getHtmlId()) ?>_page-current"
111111
name="<?= /* @escapeNotVerified */ $block->getVarNamePage() ?>"
112112
value="<?= /* @escapeNotVerified */ $_curPage ?>"
113113
class="admin__control-text"
114114
onkeypress="<?= /* @escapeNotVerified */ $block->getJsObjectName() ?>.inputPage(event, '<?= /* @escapeNotVerified */ $_lastPage ?>')" <?= /* @escapeNotVerified */ $block->getUiId('current-page') ?> />
115-
<label class="admin__control-support-text" for="<?= $block->escapeHTML($block->getHtmlId()) ?>_page-current">
115+
<label class="admin__control-support-text" for="<?= $block->escapeHtml($block->getHtmlId()) ?>_page-current">
116116
<?= /* @escapeNotVerified */ __('of %1', '<span>' . $block->getCollection()->getLastPageNumber() . '</span>') ?>
117117
</label>
118118
<?php if ($_curPage < $_lastPage): ?>

app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ public function getExtendedElement($switchAttributeCode)
142142
[
143143
'name' => "product[{$switchAttributeCode}]",
144144
'values' => $this->getOptions(),
145-
'value' => $switchAttributeCode,
146145
'class' => 'required-entry next-toinput',
147146
'no_span' => true,
148147
'disabled' => $this->isDisabledField(),

app/code/Magento/Catalog/Block/Product/ListProduct.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,13 +334,21 @@ public function prepareSortableFieldsByCategory($category)
334334
public function getIdentities()
335335
{
336336
$identities = [];
337-
foreach ($this->_getProductCollection() as $item) {
338-
$identities = array_merge($identities, $item->getIdentities());
339-
}
337+
340338
$category = $this->getLayer()->getCurrentCategory();
341339
if ($category) {
342340
$identities[] = Product::CACHE_PRODUCT_CATEGORY_TAG . '_' . $category->getId();
343341
}
342+
343+
//Check if category page shows only static block (No products)
344+
if ($category->getData('display_mode') == Category::DM_PAGE) {
345+
return $identities;
346+
}
347+
348+
foreach ($this->_getProductCollection() as $item) {
349+
$identities = array_merge($identities, $item->getIdentities());
350+
}
351+
344352
return $identities;
345353
}
346354

app/code/Magento/Catalog/Block/Product/View/Attributes.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,15 @@ public function getAdditionalData(array $excludeAttr = [])
8181
$attributes = $product->getAttributes();
8282
foreach ($attributes as $attribute) {
8383
if ($attribute->getIsVisibleOnFront() && !in_array($attribute->getAttributeCode(), $excludeAttr)) {
84-
if (is_array($value = $attribute->getFrontend()->getValue($product))) {
85-
continue;
86-
}
87-
if (!$product->hasData($attribute->getAttributeCode())) {
88-
$value = __('N/A');
89-
} elseif ((string)$value == '') {
90-
$value = __('No');
84+
$value = $attribute->getFrontend()->getValue($product);
85+
86+
if ($value instanceof Phrase) {
87+
$value = (string)$value;
9188
} elseif ($attribute->getFrontendInput() == 'price' && is_string($value)) {
9289
$value = $this->priceCurrency->convertAndFormat($value);
9390
}
94-
if ($value instanceof Phrase || (is_string($value) && strlen($value))) {
91+
92+
if (is_string($value) && strlen($value)) {
9593
$data[$attribute->getAttributeCode()] = [
9694
'label' => __($attribute->getStoreLabel()),
9795
'value' => $value,

app/code/Magento/Catalog/Block/Product/View/Gallery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function getGalleryImagesJson()
116116
'thumb' => $image->getData('small_image_url'),
117117
'img' => $image->getData('medium_image_url'),
118118
'full' => $image->getData('large_image_url'),
119-
'caption' => $image->getLabel(),
119+
'caption' => ($image->getLabel() ?: $this->getProduct()->getName()),
120120
'position' => $image->getPosition(),
121121
'isMain' => $this->isMainImage($image),
122122
'type' => str_replace('external-', '', $image->getMediaType()),

app/code/Magento/Catalog/Block/Product/View/Options/Type/Select.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ public function getValuesHtml()
4444
]
4545
);
4646
if ($_option->getType() == \Magento\Catalog\Api\Data\ProductCustomOptionInterface::OPTION_TYPE_DROP_DOWN) {
47-
$select->setName('options[' . $_option->getid() . ']')->addOption('', __('-- Please Select --'));
47+
$select->setName('options[' . $_option->getId() . ']')->addOption('', __('-- Please Select --'));
4848
} else {
49-
$select->setName('options[' . $_option->getid() . '][]');
49+
$select->setName('options[' . $_option->getId() . '][]');
5050
$select->setClass('multiselect admin__control-multiselect' . $require . ' product-custom-option');
5151
}
5252
foreach ($_option->getValues() as $_value) {

0 commit comments

Comments
 (0)