Skip to content

Commit e50846a

Browse files
committed
Merge remote-tracking branch 'origin/develop' into MAGETWO-58051
2 parents eb5fcf9 + 0a8e77a commit e50846a

File tree

78 files changed

+1712
-1027
lines changed

Some content is hidden

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

78 files changed

+1712
-1027
lines changed

CODE_OF_CONDUCT.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to creating a positive environment include:
10+
11+
* Using welcoming and inclusive language
12+
* Being respectful of differing viewpoints and experiences
13+
* Gracefully accepting constructive criticism
14+
* Focusing on what is best for the community
15+
* Showing empathy towards other community members
16+
17+
Examples of unacceptable behavior by participants include:
18+
19+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
* Trolling, insulting/derogatory comments, and personal or political attacks
21+
* Public or private harassment
22+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
23+
* Other conduct which could reasonably be considered inappropriate in a professional setting
24+
25+
## Our Responsibilities
26+
27+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28+
29+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
## Scope
32+
33+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34+
35+
## Enforcement
36+
37+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at engcom@magento.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38+
39+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40+
41+
## Attribution
42+
43+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44+
45+
[homepage]: http://contributor-covenant.org
46+
[version]: http://contributor-covenant.org/version/1/4/

app/bootstrap.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,5 @@
6363
date_default_timezone_set('UTC');
6464

6565
/* Adjustment of precision value for several versions of PHP */
66-
ini_set('precision', 17);
67-
ini_set('serialize_precision', 17);
66+
ini_set('precision', 15);
67+
ini_set('serialize_precision', 15);

app/code/Magento/BundleImportExport/Model/Import/Product/Type/Bundle.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -652,8 +652,13 @@ protected function _initAttributes()
652652
*/
653653
protected function deleteOptionsAndSelections($productIds)
654654
{
655+
if (empty($productIds)) {
656+
return $this;
657+
}
658+
655659
$optionTable = $this->_resource->getTableName('catalog_product_bundle_option');
656660
$optionValueTable = $this->_resource->getTableName('catalog_product_bundle_option_value');
661+
$selectionTable = $this->_resource->getTableName('catalog_product_bundle_selection');
657662
$valuesIds = $this->connection->fetchAssoc($this->connection->select()->from(
658663
['bov' => $optionValueTable],
659664
['value_id']
@@ -666,17 +671,16 @@ protected function deleteOptionsAndSelections($productIds)
666671
$productIds
667672
));
668673
$this->connection->delete(
669-
$optionTable,
674+
$optionValueTable,
670675
$this->connection->quoteInto('value_id IN (?)', array_keys($valuesIds))
671676
);
672-
$productIdsInWhere = $this->connection->quoteInto('parent_id IN (?)', $productIds);
673677
$this->connection->delete(
674678
$optionTable,
675-
$this->connection->quoteInto('parent_id IN (?)', $productIdsInWhere)
679+
$this->connection->quoteInto('parent_id IN (?)', $productIds)
676680
);
677681
$this->connection->delete(
678-
$optionTable,
679-
$this->connection->quoteInto('parent_product_id IN (?)', $productIdsInWhere)
682+
$selectionTable,
683+
$this->connection->quoteInto('parent_product_id IN (?)', $productIds)
680684
);
681685
return $this;
682686
}

app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Validate.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ private function isUniqueAdminValues(array $optionsValues, array $deletedOptions
128128
}
129129
}
130130
$uniqueValues = array_unique($adminValues);
131-
return ($uniqueValues === $adminValues);
131+
return array_diff_assoc($adminValues, $uniqueValues);
132132
}
133133

134134
/**
@@ -157,10 +157,16 @@ private function checkUniqueOption(DataObject $response, array $options = null)
157157
if (is_array($options)
158158
&& !empty($options['value'])
159159
&& !empty($options['delete'])
160-
&& !$this->isUniqueAdminValues($options['value'], $options['delete'])
161160
) {
162-
$this->setMessageToResponse($response, [__("The value of Admin must be unique.")]);
163-
$response->setError(true);
161+
$duplicates = $this->isUniqueAdminValues($options['value'], $options['delete']);
162+
if ($duplicates) {
163+
$this->setMessageToResponse(
164+
$response,
165+
[__('The value of Admin must be unique. (%1)', implode(', ', $duplicates))]
166+
);
167+
168+
$response->setError(true);
169+
}
164170
}
165171
return $this;
166172
}

app/code/Magento/Catalog/Model/Product/Attribute/Backend/Media/ImageEntryConverter.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,16 @@ public function convertFrom(ProductAttributeMediaGalleryEntryInterface $entry)
100100
protected function convertFromMediaGalleryEntryContentInterface(
101101
ImageContentInterface $content = null
102102
) {
103-
if ($content == null) {
103+
if ($content === null) {
104104
return null;
105-
} else {
106-
return [
107-
'data' => [
108-
ImageContentInterface::BASE64_ENCODED_DATA => $content->getBase64EncodedData(),
109-
ImageContentInterface::TYPE => $content->getType(),
110-
ImageContentInterface::NAME => $content->getName(),
111-
],
112-
];
113105
}
106+
107+
return [
108+
'data' => [
109+
ImageContentInterface::BASE64_ENCODED_DATA => $content->getBase64EncodedData(),
110+
ImageContentInterface::TYPE => $content->getType(),
111+
ImageContentInterface::NAME => $content->getName(),
112+
],
113+
];
114114
}
115115
}

app/code/Magento/Catalog/Pricing/Price/TierPrice.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function __construct(
7272
Session $customerSession,
7373
GroupManagementInterface $groupManagement
7474
) {
75-
$quantity = $quantity ?: 1;
75+
$quantity = floatval($quantity) ? $quantity : 1;
7676
parent::__construct($saleableItem, $quantity, $calculator, $priceCurrency);
7777
$this->customerSession = $customerSession;
7878
$this->groupManagement = $groupManagement;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,3 +717,4 @@ none,none
717717
Overview,Overview
718718
Details,Details
719719
"The value of Admin must be unique.", "The value of Admin must be unique."
720+
"The value of Admin must be unique. (%1)", "The value of Admin must be unique. (%1)"

app/code/Magento/Catalog/view/adminhtml/web/catalog/product/attribute/unique-validate.js

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,17 @@ define([
1010
'use strict';
1111

1212
return function (config) {
13-
var _config = jQuery.extend({
14-
element: null,
15-
message: '',
16-
uniqueClass: 'required-unique'
17-
}, config);
13+
var msg = '',
14+
_config = jQuery.extend({
15+
element: null,
16+
message: '',
17+
uniqueClass: 'required-unique'
18+
}, config),
19+
20+
/** @inheritdoc */
21+
messager = function () {
22+
return msg;
23+
};
1824

1925
if (typeof _config.element === 'string') {
2026
jQuery.validator.addMethod(
@@ -25,21 +31,27 @@ define([
2531
.closest('table')
2632
.find('.' + _config.uniqueClass + ':visible'),
2733
valuesHash = {},
28-
isValid = true;
34+
isValid = true,
35+
duplicates = [];
2936

3037
inputs.each(function (el) {
3138
var inputValue = inputs[el].value;
3239

3340
if (typeof valuesHash[inputValue] !== 'undefined') {
3441
isValid = false;
42+
duplicates.push(inputValue);
3543
}
3644
valuesHash[inputValue] = el;
3745
});
3846

47+
if (!isValid) {
48+
msg = _config.message + ' (' + duplicates.join(', ') + ')';
49+
}
50+
3951
return isValid;
4052
},
4153

42-
_config.message
54+
messager
4355
);
4456
}
4557
};

app/code/Magento/Catalog/view/frontend/templates/product/list.phtml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,10 @@ $_helper = $this->helper('Magento\Catalog\Helper\Output');
4242
$pos = $block->getPositioned();
4343
?>
4444
<div class="products wrapper <?= /* @escapeNotVerified */ $viewMode ?> products-<?= /* @escapeNotVerified */ $viewMode ?>">
45-
<?php $iterator = 1; ?>
4645
<ol class="products list items product-items">
4746
<?php /** @var $_product \Magento\Catalog\Model\Product */ ?>
4847
<?php foreach ($_productCollection as $_product): ?>
49-
<?= /* @escapeNotVerified */ ($iterator++ == 1) ? '<li class="item product product-item">' : '</li><li class="item product product-item">' ?>
48+
<li class="item product product-item">
5049
<div class="product-item-info" data-container="product-grid">
5150
<?php
5251
$productImage = $block->getImage($_product, $image);
@@ -112,7 +111,7 @@ $_helper = $this->helper('Magento\Catalog\Helper\Output');
112111
</div>
113112
</div>
114113
</div>
115-
<?= ($iterator == count($_productCollection)+1) ? '</li>' : '' ?>
114+
</li>
116115
<?php endforeach; ?>
117116
</ol>
118117
</div>

app/code/Magento/Catalog/view/frontend/templates/product/list/items.phtml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ switch ($type = $block->getType()) {
174174
<?php endif; ?>
175175
<div class="products wrapper grid products-grid products-<?= /* @escapeNotVerified */ $type ?>">
176176
<ol class="products list items product-items">
177-
<?php $iterator = 1; ?>
178177
<?php foreach ($items as $_item): ?>
179178
<?php $available = ''; ?>
180179
<?php if (!$_item->isComposite() && $_item->isSaleable() && $type == 'related'): ?>
@@ -183,9 +182,9 @@ switch ($type = $block->getType()) {
183182
<?php endif; ?>
184183
<?php endif; ?>
185184
<?php if ($type == 'related' || $type == 'upsell'): ?>
186-
<?= /* @escapeNotVerified */ ($iterator++ == 1) ? '<li class="item product product-item" style="display: none;">' : '</li><li class="item product product-item" style="display: none;">' ?>
185+
<li class="item product product-item" style="display: none;">
187186
<?php else: ?>
188-
<?= /* @escapeNotVerified */ ($iterator++ == 1) ? '<li class="item product product-item">' : '</li><li class="item product product-item">' ?>
187+
<li class="item product product-item">
189188
<?php endif; ?>
190189
<div class="product-item-info <?= /* @escapeNotVerified */ $available ?>">
191190
<?= /* @escapeNotVerified */ '<!-- ' . $image . '-->' ?>
@@ -252,7 +251,7 @@ switch ($type = $block->getType()) {
252251
<?php endif; ?>
253252
</div>
254253
</div>
255-
<?= ($iterator == count($items)+1) ? '</li>' : '' ?>
254+
</li>
256255
<?php endforeach ?>
257256
</ol>
258257
</div>

0 commit comments

Comments
 (0)