Skip to content

Commit 1beb220

Browse files
committed
Merge branch '2.3-develop' into MAGETWO-86867-cleanup
2 parents 30b4ecc + 57b5fdb commit 1beb220

File tree

91 files changed

+780
-878
lines changed

Some content is hidden

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

91 files changed

+780
-878
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,35 @@
1-
<!--- Provide a general summary of the issue in the Title above -->
2-
<!--- Before adding new issues, please, check this article https://github.com/magento/magento2/wiki/Issue-reporting-guidelines-->
1+
<!---
2+
Thank you for contributing to Magento.
3+
To help us process this issue we recommend that you add the following information:
4+
- Summary of the issue,
5+
- Information on your environment,
6+
- Steps to reproduce,
7+
- Expected and actual results,
8+
9+
Please also have a look at our guidelines article before adding a new issue https://github.com/magento/magento2/wiki/Issue-reporting-guidelines
10+
-->
311

412
### Preconditions
5-
<!--- Provide a more detailed information of environment you use -->
6-
<!--- Magento version, tag, HEAD, etc., PHP & MySQL version, etc.. -->
13+
<!---
14+
Please provide as detailed information about your environment as possible.
15+
For example Magento version, tag, HEAD, PHP & MySQL version, etc..
16+
-->
717
1.
818
2.
919

1020
### Steps to reproduce
11-
<!--- Provide a set of unambiguous steps to reproduce this bug include code, if relevant -->
21+
<!---
22+
It is important to provide a set of clear steps to reproduce this bug.
23+
If relevant please include code samples
24+
-->
1225
1.
1326
2.
1427
3.
1528

1629
### Expected result
1730
<!--- Tell us what should happen -->
18-
1.
31+
1. [Screenshot, logs]
1932

2033
### Actual result
2134
<!--- Tell us what happens instead -->
2235
1. [Screenshot, logs]
23-
24-
<!--- (This may be platform independent comment) -->

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,32 @@
1-
<!--- Provide a general summary of the Pull Request in the Title above -->
1+
<!---
2+
Thank you for contributing to Magento.
3+
To help us process this pull request we recommend that you add the following information:
4+
- Summary of the pull request,
5+
- Issue(s) related to the changes made,
6+
- Manual testing scenarios,
7+
-->
8+
9+
<!--- Please provide a general summary of the Pull Request in the Title above -->
210

311
### Description
4-
<!--- Provide a description of the changes proposed in the pull request -->
12+
<!---
13+
Please provide a description of the changes proposed in the pull request.
14+
Letting us know what has changed and why it needed changing will help us validate this pull request.
15+
-->
516

617
### Fixed Issues (if relevant)
7-
<!--- Provide a list of fixed issues in the format magento/magento2#<issue_number>, if relevant -->
18+
<!---
19+
If relevant, please provide a list of fixed issues in the format magento/magento2#<issue_number>.
20+
There could be 1 or more issues linked here and it will help us find some more information about the reasoning behind this change.
21+
-->
822
1. magento/magento2#<issue_number>: Issue title
923
2. ...
1024

1125
### Manual testing scenarios
12-
<!--- Provide a set of unambiguous steps to test the proposed code change -->
26+
<!---
27+
Please provide a set of unambiguous steps to test the proposed code change.
28+
Giving us manual testing scenarios will help with the processing and validation process.
29+
-->
1330
1. ...
1431
2. ...
1532

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ language: php
1818
php:
1919
- 7.1
2020
- 7.2
21-
git:
22-
depth: 5
2321
env:
2422
global:
2523
- COMPOSER_BIN_DIR=~/bin

app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Massaction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function render(\Magento\Framework\DataObject $row)
6565
*/
6666
protected function _getCheckboxHtml($value, $checked)
6767
{
68-
$id = 'id_' . rand(0, 999);
68+
$id = 'id_' . random_int(0, 999);
6969
$html = '<label class="data-grid-checkbox-cell-inner" for="'. $id .'">';
7070
$html .= '<input type="checkbox" name="' . $this->getColumn()->getName() . '" ';
7171
$html .= 'id="' . $id . '" data-role="select-row"';

app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ protected function getTemporaryTreeIndexTableName()
597597
if (empty($this->tempTreeIndexTableName)) {
598598
$this->tempTreeIndexTableName = $this->connection->getTableName('temp_catalog_category_tree_index')
599599
. '_'
600-
. substr(md5(time() . rand(0, 999999999)), 0, 8);
600+
. substr(md5(time() . random_int(0, 999999999)), 0, 8);
601601
}
602602

603603
return $this->tempTreeIndexTableName;
@@ -659,25 +659,30 @@ protected function makeTempCategoryTreeIndex()
659659
*/
660660
protected function fillTempCategoryTreeIndex($temporaryName)
661661
{
662-
// This finds all children (cc2) that descend from a parent (cc) by path.
663-
// For example, cc.path may be '1/2', and cc2.path may be '1/2/3/4/5'.
664-
$temporarySelect = $this->connection->select()->from(
665-
['cc' => $this->getTable('catalog_category_entity')],
666-
['parent_id' => 'entity_id']
667-
)->joinInner(
668-
['cc2' => $this->getTable('catalog_category_entity')],
669-
'cc2.path LIKE ' . $this->connection->getConcatSql(
670-
[$this->connection->quoteIdentifier('cc.path'), $this->connection->quote('/%')]
671-
),
672-
['child_id' => 'entity_id']
662+
$selects = $this->prepareSelectsByRange(
663+
$this->connection->select()
664+
->from(
665+
['c' => $this->getTable('catalog_category_entity')],
666+
['entity_id', 'path']
667+
),
668+
'entity_id'
673669
);
674670

675-
$this->connection->query(
676-
$temporarySelect->insertFromSelect(
677-
$temporaryName,
678-
['parent_id', 'child_id']
679-
)
680-
);
671+
foreach ($selects as $select) {
672+
$values = [];
673+
674+
foreach ($this->connection->fetchAll($select) as $category) {
675+
foreach (explode('/', $category['path']) as $parentId) {
676+
if ($parentId !== $category['entity_id']) {
677+
$values[] = [$parentId, $category['entity_id']];
678+
}
679+
}
680+
}
681+
682+
if (count($values) > 0) {
683+
$this->connection->insertArray($temporaryName, ['parent_id', 'child_id'], $values);
684+
}
685+
}
681686
}
682687

683688
/**

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ define([
2020
optionConfig: {},
2121
optionHandlers: {},
2222
optionTemplate: '<%= data.label %>' +
23-
'<% if (data.finalPrice.value) { %>' +
23+
'<% if (data.finalPrice.value > 0) { %>' +
2424
' +<%- data.finalPrice.formatted %>' +
25+
'<% } else if (data.finalPrice.value < 0) { %>' +
26+
' <%- data.finalPrice.formatted %>' +
2527
'<% } %>',
2628
controlContainer: 'dd'
2729
};

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ $viewModel = $block->getData('viewModel');
1111
"breadcrumbs": {
1212
"categoryUrlSuffix": "<?= $block->escapeHtml($viewModel->getCategoryUrlSuffix()); ?>",
1313
"useCategoryPathInUrl": <?= (int)$viewModel->isCategoryUsedInProductUrl(); ?>,
14-
"product": "<?= $block->escapeHtml($viewModel->getProductName()); ?>"
14+
"product": "<?= $block->escapeHtml($block->escapeJsQuote($viewModel->getProductName(), '"')); ?>"
1515
}
1616
}'>
1717
</div>

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
?>
1111
<?php $_total = $block->getItems()->getSize() ?>
1212
<?php if ($_total): ?>
13-
<a href="#" class="action print" title="<?= /* @escapeNotVerified */ __('Print This Page') ?>">
13+
<a href="#" class="action print hidden-print" title="<?= /* @escapeNotVerified */ __('Print This Page') ?>">
1414
<span><?= /* @escapeNotVerified */ __('Print This Page') ?></span>
1515
</a>
1616
<div class="table-wrapper comparison">
@@ -29,7 +29,7 @@
2929
<?php if ($_i++ == 0): ?>
3030
<th scope="row" class="cell label remove"><span><?= /* @escapeNotVerified */ __('Remove Product') ?></span></th>
3131
<?php endif; ?>
32-
<td class="cell remove product">
32+
<td class="cell remove product hidden-print">
3333
<?php $compareHelper = $this->helper('Magento\Catalog\Helper\Product\Compare');?>
3434
<a href="#" data-post='<?= /* @escapeNotVerified */ $compareHelper->getPostDataRemove($_item) ?>'
3535
class="action delete" title="<?= /* @escapeNotVerified */ __('Remove Product') ?>">
@@ -59,7 +59,7 @@
5959
</strong>
6060
<?= $block->getReviewsSummaryHtml($_item, 'short') ?>
6161
<?= /* @escapeNotVerified */ $block->getProductPrice($_item, '-compare-list-top') ?>
62-
<div class="product-item-actions">
62+
<div class="product-item-actions hidden-print">
6363
<div class="actions-primary">
6464
<?php if ($_item->isSaleable()): ?>
6565
<form data-role="tocart-form" action="<?= /* @escapeNotVerified */ $this->helper('Magento\Catalog\Helper\Product\Compare')->getAddToCartUrl($_item) ?>" method="post">

app/code/Magento/Customer/Model/Customer/NotificationStorage.php

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
namespace Magento\Customer\Model\Customer;
77

8+
use Magento\Framework\App\ObjectManager;
89
use Magento\Framework\Cache\FrontendInterface;
910
use Magento\Framework\Serialize\SerializerInterface;
1011

@@ -18,21 +19,21 @@ class NotificationStorage
1819
private $cache;
1920

2021
/**
21-
* @param FrontendInterface $cache
22-
*/
23-
24-
/**
25-
* @param FrontendInterface $cache
22+
* @var SerializerInterface
2623
*/
2724
private $serializer;
2825

2926
/**
3027
* NotificationStorage constructor.
3128
* @param FrontendInterface $cache
29+
* @param SerializerInterface $serializer
3230
*/
33-
public function __construct(FrontendInterface $cache)
34-
{
31+
public function __construct(
32+
FrontendInterface $cache,
33+
SerializerInterface $serializer = null
34+
) {
3535
$this->cache = $cache;
36+
$this->serializer = $serializer ?: ObjectManager::getInstance()->get(SerializerInterface::class);
3637
}
3738

3839
/**
@@ -45,7 +46,7 @@ public function __construct(FrontendInterface $cache)
4546
public function add($notificationType, $customerId)
4647
{
4748
$this->cache->save(
48-
$this->getSerializer()->serialize([
49+
$this->serializer->serialize([
4950
'customer_id' => $customerId,
5051
'notification_type' => $notificationType
5152
]),
@@ -88,19 +89,4 @@ private function getCacheKey($notificationType, $customerId)
8889
{
8990
return 'notification_' . $notificationType . '_' . $customerId;
9091
}
91-
92-
/**
93-
* Get serializer
94-
*
95-
* @return SerializerInterface
96-
* @deprecated 100.2.0
97-
*/
98-
private function getSerializer()
99-
{
100-
if ($this->serializer === null) {
101-
$this->serializer = \Magento\Framework\App\ObjectManager::getInstance()
102-
->get(SerializerInterface::class);
103-
}
104-
return $this->serializer;
105-
}
10692
}

app/code/Magento/Eav/Model/Entity/Attribute/Frontend/AbstractFrontend.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public function getValue(\Magento\Framework\DataObject $object)
165165
$options = $opt->getAllOptions();
166166
if ($options) {
167167
foreach ($options as $option) {
168-
if ($option['value'] == $value) {
168+
if ($option['value'] === $value) {
169169
$valueOption = $option['label'];
170170
}
171171
}

0 commit comments

Comments
 (0)