Skip to content

Commit

Permalink
Merge pull request magento#1206 from magento-engcom/merge-mainline
Browse files Browse the repository at this point in the history
Merge mainline
  • Loading branch information
Valeriy Nayda authored May 22, 2018
2 parents 63dd901 + ac24e13 commit a808e30
Show file tree
Hide file tree
Showing 393 changed files with 10,532 additions and 3,026 deletions.
27 changes: 19 additions & 8 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,35 @@
<!--- Provide a general summary of the issue in the Title above -->
<!--- Before adding new issues, please, check this article https://github.com/magento/magento2/wiki/Issue-reporting-guidelines-->
<!---
Thank you for contributing to Magento.
To help us process this issue we recommend that you add the following information:
- Summary of the issue,
- Information on your environment,
- Steps to reproduce,
- Expected and actual results,
Please also have a look at our guidelines article before adding a new issue https://github.com/magento/magento2/wiki/Issue-reporting-guidelines
-->

### Preconditions
<!--- Provide a more detailed information of environment you use -->
<!--- Magento version, tag, HEAD, etc., PHP & MySQL version, etc.. -->
<!---
Please provide as detailed information about your environment as possible.
For example Magento version, tag, HEAD, PHP & MySQL version, etc..
-->
1.
2.

### Steps to reproduce
<!--- Provide a set of unambiguous steps to reproduce this bug include code, if relevant -->
<!---
It is important to provide a set of clear steps to reproduce this bug.
If relevant please include code samples
-->
1.
2.
3.

### Expected result
<!--- Tell us what should happen -->
1.
1. [Screenshot, logs]

### Actual result
<!--- Tell us what happens instead -->
1. [Screenshot, logs]

<!--- (This may be platform independent comment) -->
25 changes: 21 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,32 @@
<!--- Provide a general summary of the Pull Request in the Title above -->
<!---
Thank you for contributing to Magento.
To help us process this pull request we recommend that you add the following information:
- Summary of the pull request,
- Issue(s) related to the changes made,
- Manual testing scenarios,
-->

<!--- Please provide a general summary of the Pull Request in the Title above -->

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

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

### Manual testing scenarios
<!--- Provide a set of unambiguous steps to test the proposed code change -->
<!---
Please provide a set of unambiguous steps to test the proposed code change.
Giving us manual testing scenarios will help with the processing and validation process.
-->
1. ...
2. ...

Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sudo: required
\sudo: required
dist: trusty
group: edge
addons:
Expand All @@ -22,7 +22,7 @@ env:
global:
- COMPOSER_BIN_DIR=~/bin
- INTEGRATION_SETS=4
- NODE_JS_VERSION=6
- NODE_JS_VERSION=8
- MAGENTO_HOST_NAME="magento2.travis"
matrix:
- TEST_SUITE=unit
Expand Down
2 changes: 1 addition & 1 deletion COPYING.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright © 2013-2018 Magento, Inc.
Copyright © 2013-present Magento, Inc.

Each Magento source file included in this distribution is licensed under OSL 3.0 or the Magento Enterprise Edition (MEE) license

Expand Down
25 changes: 23 additions & 2 deletions app/code/Magento/AdvancedSearch/Model/ResourceModel/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
use Magento\Framework\Model\ResourceModel\Db\Context;
use Magento\Framework\EntityManager\MetadataPool;
use Magento\Catalog\Api\Data\CategoryInterface;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\Indexer\ScopeResolver\IndexScopeResolver as TableResolver;
use Magento\Framework\Search\Request\Dimension;
use Magento\Catalog\Model\Indexer\Category\Product\AbstractAction;

/**
* @api
Expand All @@ -29,22 +33,30 @@ class Index extends AbstractDb
*/
protected $metadataPool;

/**
* @var TableResolver
*/
private $tableResolver;

/**
* Index constructor.
* @param Context $context
* @param StoreManagerInterface $storeManager
* @param MetadataPool $metadataPool
* @param null $connectionName
* @param TableResolver|null $tableResolver
*/
public function __construct(
Context $context,
StoreManagerInterface $storeManager,
MetadataPool $metadataPool,
$connectionName = null
$connectionName = null,
TableResolver $tableResolver = null
) {
parent::__construct($context, $connectionName);
$this->storeManager = $storeManager;
$this->metadataPool = $metadataPool;
$this->tableResolver = $tableResolver ?: ObjectManager::getInstance()->get(TableResolver::class);
}

/**
Expand Down Expand Up @@ -116,8 +128,17 @@ public function getCategoryProductIndexData($storeId = null, $productIds = null)
{
$connection = $this->getConnection();

$catalogCategoryProductDimension = new Dimension(\Magento\Store\Model\Store::ENTITY, $storeId);

$catalogCategoryProductTableName = $this->tableResolver->resolve(
AbstractAction::MAIN_INDEX_TABLE,
[
$catalogCategoryProductDimension
]
);

$select = $connection->select()->from(
[$this->getTable('catalog_category_product_index')],
[$catalogCategoryProductTableName],
['category_id', 'product_id', 'position', 'store_id']
)->where(
'store_id = ?',
Expand Down
7 changes: 6 additions & 1 deletion app/code/Magento/Backend/Block/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

declare(strict_types=1);

namespace Magento\Backend\Block;

/**
Expand All @@ -17,10 +20,12 @@
* Example:
* <block name="my.block" class="Magento\Backend\Block\Template" template="My_Module::template.phtml" >
* <arguments>
* <argument name="viewModel" xsi:type="object">My\Module\ViewModel\Custom</argument>
* <argument name="view_model" xsi:type="object">My\Module\ViewModel\Custom</argument>
* </arguments>
* </block>
*
* Your class object can then be accessed by doing $block->getViewModel()
*
* @api
* @SuppressWarnings(PHPMD.NumberOfChildren)
* @since 100.0.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function render(\Magento\Framework\DataObject $row)
*/
protected function _getCheckboxHtml($value, $checked)
{
$id = 'id_' . rand(0, 999);
$id = 'id_' . random_int(0, 999);
$html = '<label class="data-grid-checkbox-cell-inner" for="'. $id .'">';
$html .= '<input type="checkbox" name="' . $this->getColumn()->getName() . '" ';
$html .= 'id="' . $id . '" data-role="select-row"';
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Backend/etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
<field id="template_hints_blocks" translate="label" type="select" sortOrder="21" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Add Block Names to Hints</label>
<label>Add Block Class Type to Hints</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
</group>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ public function __construct(
public function beforeSave()
{
$value = $this->getValue();
if (!is_array($value)) {
try {
$value = $this->serializer->unserialize($value);
} catch (\InvalidArgumentException $e) {
$value = [];
}
}
$result = [];
foreach ($value as $data) {
if (empty($data['country_id']) || empty($data['cc_types'])) {
Expand Down
Loading

0 comments on commit a808e30

Please sign in to comment.