Skip to content

Commit 679b1c7

Browse files
author
Joan He
committed
Merge remote-tracking branch 'upstream/develop' into MAGETWO-43197-missing-interceptor
2 parents 8f1d025 + e5dedb8 commit 679b1c7

File tree

30 files changed

+204
-326
lines changed

30 files changed

+204
-326
lines changed

app/code/Magento/AdminNotification/view/adminhtml/templates/system/messages/popup.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
?>
1010
<?php /** @var $block \Magento\AdminNotification\Block\System\Messages\UnreadMessagePopup */ ?>
1111

12-
<div id="system_messages_list" title="<?php echo $block->escapeHtml($block->getPopupTitle()); ?>">
12+
<div style="display:none" id="system_messages_list" title="<?php echo $block->escapeHtml($block->getPopupTitle()); ?>">
1313
<ul class="message-system-list">
1414
<?php foreach ($block->getUnreadMessages() as $message): ?>
1515
<li class="message message-warning <?php /* @escapeNotVerified */ echo $block->getItemClass($message);?>">

app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/braintree-paypal.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@ define(
4747
return {
4848
'method': this.item.method,
4949
'po_number': null,
50-
'cc_owner': null,
51-
'cc_number': null,
52-
'cc_type': null,
53-
'cc_exp_year': null,
54-
'cc_exp_month': null,
5550
'additional_data': {
5651
'payment_method_nonce': this.paymentMethodNonce()
5752
}

app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/cc-form.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,15 +173,15 @@ define(
173173
getData: function () {
174174
return {
175175
'method': this.item.method,
176-
'cc_type': this.creditCardType(),
177-
'cc_exp_year': this.creditCardExpYear(),
178-
'cc_exp_month': this.creditCardExpMonth(),
179176
'additional_data': {
180177
'cc_last4': this.creditCardNumber().slice(-4),
181178
'store_in_vault': this.storeInVault(),
182179
'payment_method_nonce': this.paymentMethodNonce(),
183180
'cc_token': this.selectedCardToken(),
184-
'device_data': this.deviceData
181+
'device_data': this.deviceData,
182+
'cc_type': this.creditCardType(),
183+
'cc_exp_year': this.creditCardExpYear(),
184+
'cc_exp_month': this.creditCardExpMonth()
185185
}
186186
};
187187
},

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ public function prepareSortableFieldsByCategory($category)
296296
}
297297
$availableOrders = $this->getAvailableOrders();
298298
if (!$this->getSortBy()) {
299-
$categorySortBy = $category->getDefaultSortBy();
299+
$categorySortBy = $this->getDefaultSortBy() ?: $category->getDefaultSortBy();
300300
if ($categorySortBy) {
301301
if (!$availableOrders) {
302302
$availableOrders = $this->_getConfig()->getAttributeUsedForSortByArray();

app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
namespace Magento\Catalog\Block\Product\ProductList;
77

8+
use Magento\Catalog\Helper\Product\ProductList;
89
use Magento\Catalog\Model\Product\ProductList\Toolbar as ToolbarModel;
910

1011
/**
@@ -63,7 +64,7 @@ class Toolbar extends \Magento\Framework\View\Element\Template
6364
*
6465
* @var string
6566
*/
66-
protected $_direction = \Magento\Catalog\Helper\Product\ProductList::DEFAULT_SORT_DIRECTION;
67+
protected $_direction = ProductList::DEFAULT_SORT_DIRECTION;
6768

6869
/**
6970
* Default View mode
@@ -102,7 +103,7 @@ class Toolbar extends \Magento\Framework\View\Element\Template
102103
protected $_toolbarModel;
103104

104105
/**
105-
* @var \Magento\Catalog\Helper\Product\ProductList
106+
* @var ProductList
106107
*/
107108
protected $_productListHelper;
108109

@@ -122,7 +123,7 @@ class Toolbar extends \Magento\Framework\View\Element\Template
122123
* @param \Magento\Catalog\Model\Config $catalogConfig
123124
* @param ToolbarModel $toolbarModel
124125
* @param \Magento\Framework\Url\EncoderInterface $urlEncoder
125-
* @param \Magento\Catalog\Helper\Product\ProductList $productListHelper
126+
* @param ProductList $productListHelper
126127
* @param \Magento\Framework\Data\Helper\PostHelper $postDataHelper
127128
* @param array $data
128129
*/
@@ -132,7 +133,7 @@ public function __construct(
132133
\Magento\Catalog\Model\Config $catalogConfig,
133134
ToolbarModel $toolbarModel,
134135
\Magento\Framework\Url\EncoderInterface $urlEncoder,
135-
\Magento\Catalog\Helper\Product\ProductList $productListHelper,
136+
ProductList $productListHelper,
136137
\Magento\Framework\Data\Helper\PostHelper $postDataHelper,
137138
array $data = []
138139
) {
@@ -355,7 +356,7 @@ public function removeOrderFromAvailableOrders($order)
355356
}
356357

357358
/**
358-
* Compare defined order field vith current order field
359+
* Compare defined order field with current order field
359360
*
360361
* @param string $order
361362
* @return bool
@@ -375,7 +376,7 @@ public function getPagerUrl($params = [])
375376
{
376377
$urlParams = [];
377378
$urlParams['_current'] = true;
378-
$urlParams['_escape'] = true;
379+
$urlParams['_escape'] = false;
379380
$urlParams['_use_rewrite'] = true;
380381
$urlParams['_query'] = $params;
381382
return $this->getUrl('*/*/*', $urlParams);
@@ -678,7 +679,7 @@ public function getWidgetOptionsJson(array $customOptions = [])
678679
'order' => ToolbarModel::ORDER_PARAM_NAME,
679680
'limit' => ToolbarModel::LIMIT_PARAM_NAME,
680681
'modeDefault' => $defaultMode,
681-
'directionDefault' => \Magento\Catalog\Helper\Product\ProductList::DEFAULT_SORT_DIRECTION,
682+
'directionDefault' => $this->_direction ?: ProductList::DEFAULT_SORT_DIRECTION,
682683
'orderDefault' => $this->_productListHelper->getDefaultSortField(),
683684
'limitDefault' => $this->_productListHelper->getDefaultLimitPerPageValue($defaultMode),
684685
'url' => $this->getPagerUrl(),

app/code/Magento/Catalog/Setup/UpgradeData.php

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,31 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
4646
$entityTypeId = $categorySetup->getEntityTypeId(\Magento\Catalog\Model\Product::ENTITY);
4747
$attributeSetId = $categorySetup->getDefaultAttributeSetId($entityTypeId);
4848

49-
$attributeGroupId = $categorySetup->getAttributeGroupId($entityTypeId, $attributeSetId, 'Images');
50-
51-
// update General Group
52-
$categorySetup->updateAttributeGroup(
49+
$attributeGroup = $categorySetup->getAttributeGroup(
5350
$entityTypeId,
5451
$attributeSetId,
55-
$attributeGroupId,
56-
'attribute_group_name',
57-
'Images and Videos'
52+
'Images',
53+
'attribute_group_name'
5854
);
55+
if (isset($attributeGroup['attribute_group_name']) && $attributeGroup['attribute_group_name'] == 'Images') {
56+
// update General Group
57+
$categorySetup->updateAttributeGroup(
58+
$entityTypeId,
59+
$attributeSetId,
60+
$attributeGroup['attribute_group_id'],
61+
'attribute_group_name',
62+
'Images and Videos'
63+
);
64+
}
65+
}
66+
67+
if ($context->getVersion()
68+
&& version_compare($context->getVersion(), '2.0.1') < 0
69+
) {
5970
$select = $setup->getConnection()->select()
6071
->from(
6172
$setup->getTable('catalog_product_entity_group_price'),
6273
[
63-
'value_id',
6474
'entity_id',
6575
'all_groups',
6676
'customer_group_id',
@@ -69,11 +79,10 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
6979
'website_id'
7080
]
7181
);
72-
$setup->getConnection()->insertFromSelect(
82+
$select = $setup->getConnection()->insertFromSelect(
7383
$select,
74-
$setup->getTable('catalog_product_entity_group_price'),
84+
$setup->getTable('catalog_product_entity_tier_price'),
7585
[
76-
'value_id',
7786
'entity_id',
7887
'all_groups',
7988
'customer_group_id',
@@ -82,6 +91,8 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
8291
'website_id'
8392
]
8493
);
94+
$setup->getConnection()->query($select);
95+
8596
$categorySetupManager = $this->categorySetupFactory->create();
8697
$categorySetupManager->removeAttribute(\Magento\Catalog\Model\Product::ENTITY, 'group_price');
8798
}

app/code/Magento/Catalog/Setup/UpgradeSchema.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ protected function addForeignKeys(SchemaSetupInterface $setup)
140140
*/
141141
private function addSupportVideoMediaAttributes(SchemaSetupInterface $setup)
142142
{
143+
if ($setup->tableExists(Media::GALLERY_VALUE_TO_ENTITY_TABLE)) {
144+
return;
145+
};
146+
143147
/** Add support video media attribute */
144148
$this->createValueToEntityTable($setup);
145149
/**

app/code/Magento/Catalog/view/frontend/web/js/product/list/toolbar.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ define([
6868
parameters;
6969
for (var i = 0; i < urlParams.length; i++) {
7070
parameters = urlParams[i].split('=');
71-
paramData[parameters[0]] = parameters[1] !== undefined ? parameters[1] : '';
71+
paramData[parameters[0]] = parameters[1] !== undefined
72+
? window.decodeURIComponent(parameters[1].replace(/\+/g, '%20'))
73+
: '';
7274
}
7375
paramData[paramName] = paramValue;
7476
if (paramValue == defaultValue) {
@@ -81,4 +83,4 @@ define([
8183
});
8284

8385
return $.mage.productListToolbarForm;
84-
});
86+
});

app/code/Magento/CatalogSearch/Block/Result.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,13 @@ public function setListOrders()
133133
/* @var $category \Magento\Catalog\Model\Category */
134134
$availableOrders = $category->getAvailableSortByOptions();
135135
unset($availableOrders['position']);
136+
$availableOrders['relevance'] = __('Relevance');
136137

137138
$this->getListBlock()->setAvailableOrders(
138139
$availableOrders
139140
)->setDefaultDirection(
140141
'desc'
141-
)->setSortBy(
142+
)->setDefaultSortBy(
142143
'relevance'
143144
);
144145

app/code/Magento/Checkout/view/frontend/web/js/view/payment/default.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,6 @@ define(
157157
return {
158158
"method": this.item.method,
159159
"po_number": null,
160-
"cc_owner": null,
161-
"cc_number": null,
162-
"cc_type": null,
163-
"cc_exp_year": null,
164-
"cc_exp_month": null,
165160
"additional_data": null
166161
};
167162
},

0 commit comments

Comments
 (0)