Skip to content

Commit a03fd49

Browse files
author
Igor Melnikov
committed
Merge branch 'upstream-develop' into MAGETWO-48729-varnish-cache-doesnt-purge
2 parents 93aaf4e + 2abc5a3 commit a03fd49

File tree

40 files changed

+1319
-654
lines changed

40 files changed

+1319
-654
lines changed

app/code/Magento/Backend/view/adminhtml/templates/admin/login.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
value=""
2828
data-validate="{required:true}"
2929
placeholder="<?php /* @escapeNotVerified */ echo __('user name') ?>"
30-
autocomplete="username"
30+
autocomplete="off"
3131
/>
3232
</div>
3333
</div>
@@ -43,7 +43,7 @@
4343
data-validate="{required:true}"
4444
value=""
4545
placeholder="<?php /* @escapeNotVerified */ echo __('password') ?>"
46-
autocomplete="current-password"
46+
autocomplete="off"
4747
/>
4848
</div>
4949
</div>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ define([
205205
container: 'paypal-container',
206206
singleUse: true,
207207
headless: true,
208-
amount: this.amount,
208+
amount: this.grandTotalAmount,
209209
currency: totals['base_currency_code'],
210210
locale: this.getLocale(),
211211
enableShippingAddress: true,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function execute($entityType, $product)
6262
}
6363
}
6464

65-
$value['images'][] = $mediaEntry;
65+
$value['images'][$mediaEntry['value_id']] = $mediaEntry;
6666
}
6767

6868
$product->setData(

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,6 +1233,15 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con
12331233
$installer->getIdxName('catalog_category_product', ['product_id']),
12341234
['product_id']
12351235
)
1236+
->addIndex(
1237+
$installer->getIdxName(
1238+
'catalog_category_product',
1239+
['category_id', 'product_id'],
1240+
\Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE
1241+
),
1242+
['category_id', 'product_id'],
1243+
['type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE]
1244+
)
12361245
->addForeignKey(
12371246
$installer->getFkName('catalog_category_product', 'product_id', 'catalog_product_entity', 'entity_id'),
12381247
'product_id',

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,30 @@ public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $con
2929
$this->removeGroupPrice($setup);
3030
}
3131

32+
if (version_compare($context->getVersion(), '2.0.6', '<')) {
33+
$this->addUniqueKeyToCategoryProductTable($setup);
34+
}
3235
$setup->endSetup();
3336
}
3437

38+
/**
39+
* @param SchemaSetupInterface $setup
40+
* @return void
41+
*/
42+
protected function addUniqueKeyToCategoryProductTable(SchemaSetupInterface $setup)
43+
{
44+
$setup->getConnection()->addIndex(
45+
$setup->getTable('catalog_category_product'),
46+
$setup->getIdxName(
47+
'catalog_category_product',
48+
['category_id', 'product_id'],
49+
\Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE
50+
),
51+
['category_id', 'product_id'],
52+
\Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE
53+
);
54+
}
55+
3556
/**
3657
*
3758
* @param SchemaSetupInterface $setup

app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/options.phtml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,15 @@
7777
<?php
7878
$values = [];
7979
foreach($block->getOptionValues() as $value) {
80-
array_push($values, $value->getData());
80+
$value = $value->getData();
81+
$values[] = is_array($value) ? array_map("htmlspecialchars_decode", $value) : $value;
8182
}
8283
?>
8384
<script type="text/x-magento-init">
8485
{
8586
"*": {
8687
"Magento_Catalog/js/options": {
87-
"attributesData": <?php /* @escapeNotVerified */ echo json_encode($values); ?>,
88+
"attributesData": <?php /* @noEscape */ echo json_encode($values, JSON_HEX_QUOT); ?>,
8889
"isSortable": <?php echo (int)(!$block->getReadOnly() && !$block->canManageOptionDefaultOnly()) ?>,
8990
"isReadOnly": <?php echo (int)$block->getReadOnly(); ?>
9091
}

app/code/Magento/Catalog/view/adminhtml/web/js/options.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ define([
5454

5555
if (render) {
5656
this.render();
57+
this.updateItemsCountField();
5758
}
5859
},
5960
remove: function (event) {
@@ -136,10 +137,7 @@ define([
136137
}
137138
};
138139

139-
if ($('add_new_option_button')) {
140-
Event.observe('add_new_option_button', 'click', attributeOption.add.bind(attributeOption, {}, true));
141-
}
142-
140+
Event.observe('add_new_option_button', 'click', attributeOption.add.bind(attributeOption, {}, true));
143141
$('manage-options-panel').on('click', '.delete-option', function (event) {
144142
attributeOption.remove(event);
145143
});

app/code/Magento/Catalog/view/adminhtml/web/js/product-gallery.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ define([
165165
imgElement;
166166

167167
imageData = $.extend({
168-
'file_id': Math.random().toString(33).substr(2, 18),
168+
'file_id': imageData.value_id ? imageData.value_id : Math.random().toString(33).substr(2, 18),
169169
'disabled': imageData.disabled ? imageData.disabled : 0,
170170
'position': count + 1,
171171
sizeLabel: bytesToSize(imageData.size)

app/code/Magento/Catalog/view/base/web/js/price-options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ define([
1818
optionsSelector: '.product-custom-option',
1919
optionConfig: {},
2020
optionHandlers: {},
21-
optionTemplate: '<%- data.label %>' +
21+
optionTemplate: '<%= data.label %>' +
2222
'<% if (data.finalPrice.value) { %>' +
2323
' +<%- data.finalPrice.formatted %>' +
2424
'<% } %>',

app/code/Magento/CatalogInventory/Model/ResourceModel/Indexer/Stock/DefaultStock.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ protected function _getStockStatusSelect($entityIds = null, $usePrimaryTable = f
196196
)->columns(['qty' => new \Zend_Db_Expr('SUM(' . $qtyExpr . ')')])
197197
->where('cw.website_id != 0')
198198
->where('e.type_id = ?', $this->getTypeId())
199-
->group('e.entity_id');
199+
->group(['e.entity_id', 'cw.website_id']);
200200

201201
// add limitation of status
202202
$condition = $connection->quoteInto(

0 commit comments

Comments
 (0)