Skip to content

Commit 2317aa3

Browse files
author
Serhiy Shkolyarenko
committed
Merge remote-tracking branch 'mainline/develop' into bugs
2 parents 4dd6188 + e0a56a7 commit 2317aa3

File tree

190 files changed

+2780
-816
lines changed

Some content is hidden

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

190 files changed

+2780
-816
lines changed

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

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,25 @@ public function render(\Magento\Framework\DataObject $row)
7777
{
7878
$values = $this->_getValues();
7979
$value = $row->getData($this->getColumn()->getIndex());
80+
$checked = '';
8081
if (is_array($values)) {
8182
$checked = in_array($value, $values) ? ' checked="checked"' : '';
8283
} else {
83-
$checked = $value === $this->getColumn()->getValue() ? ' checked="checked"' : '';
84+
$checkedValue = $this->getColumn()->getValue();
85+
if ($checkedValue !== null) {
86+
$checked = $value === $checkedValue ? ' checked="checked"' : '';
87+
}
8488
}
8589

90+
$disabled = '';
8691
$disabledValues = $this->getColumn()->getDisabledValues();
8792
if (is_array($disabledValues)) {
8893
$disabled = in_array($value, $disabledValues) ? ' disabled="disabled"' : '';
8994
} else {
90-
$disabled = $value === $this->getColumn()->getDisabledValue() ? ' disabled="disabled"' : '';
95+
$disabledValue = $this->getColumn()->getDisabledValue();
96+
if ($disabledValue !== null) {
97+
$disabled = $value === $disabledValue ? ' disabled="disabled"' : '';
98+
}
9199
}
92100

93101
$this->setDisabled($disabled);
@@ -108,15 +116,18 @@ public function render(\Magento\Framework\DataObject $row)
108116
*/
109117
protected function _getCheckboxHtml($value, $checked)
110118
{
111-
$html = '<input type="checkbox" ';
119+
$html = '<label class="data-grid-checkbox-cell-inner" ';
120+
$html .= ' for="id_' . $this->escapeHtml($value) . '">';
121+
$html .= '<input type="checkbox" ';
112122
$html .= 'name="' . $this->getColumn()->getFieldName() . '" ';
113123
$html .= 'value="' . $this->escapeHtml($value) . '" ';
124+
$html .= 'id="id_' . $this->escapeHtml($value) . '" ';
114125
$html .= 'class="' .
115126
($this->getColumn()->getInlineCss() ? $this->getColumn()->getInlineCss() : 'checkbox') .
116-
' admin__control-checkbox' .
117-
'"';
127+
' admin__control-checkbox' . '"';
118128
$html .= $checked . $this->getDisabled() . '/>';
119-
$html .= '<label></label>';
129+
$html .= '<label for="id_' . $this->escapeHtml($value) . '"></label>';
130+
$html .= '</label>';
120131
/* ToDo UI: add class="admin__field-label" after some refactoring _fields.less */
121132
return $html;
122133
}

app/code/Magento/Backend/Model/Session/AdminConfig.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ class AdminConfig extends Config
3030
protected $_frontNameResolver;
3131

3232
/**
33-
* @var \Magento\Store\Model\StoreManagerInterface
33+
* @var \Magento\Backend\App\BackendAppList
3434
*/
35-
protected $_storeManager;
35+
private $backendAppList;
3636

3737
/**
38-
* @var \Magento\Backend\App\BackendAppList
38+
* @var \Magento\Backend\Model\UrlFactory
3939
*/
40-
private $backendAppList;
40+
private $backendUrlFactory;
4141

4242
/**
4343
* @param \Magento\Framework\ValidatorFactory $validatorFactory
@@ -49,7 +49,7 @@ class AdminConfig extends Config
4949
* @param string $scopeType
5050
* @param \Magento\Backend\App\BackendAppList $backendAppList
5151
* @param FrontNameResolver $frontNameResolver
52-
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
52+
* @param \Magento\Backend\Model\UrlFactory $backendUrlFactory
5353
* @param string $lifetimePath
5454
* @param string $sessionName
5555
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
@@ -64,7 +64,7 @@ public function __construct(
6464
$scopeType,
6565
\Magento\Backend\App\BackendAppList $backendAppList,
6666
FrontNameResolver $frontNameResolver,
67-
\Magento\Store\Model\StoreManagerInterface $storeManager,
67+
\Magento\Backend\Model\UrlFactory $backendUrlFactory,
6868
$lifetimePath = self::XML_PATH_COOKIE_LIFETIME,
6969
$sessionName = self::SESSION_NAME_ADMIN
7070
) {
@@ -79,8 +79,8 @@ public function __construct(
7979
$lifetimePath
8080
);
8181
$this->_frontNameResolver = $frontNameResolver;
82-
$this->_storeManager = $storeManager;
8382
$this->backendAppList = $backendAppList;
83+
$this->backendUrlFactory = $backendUrlFactory;
8484
$adminPath = $this->extractAdminPath();
8585
$this->setCookiePath($adminPath);
8686
$this->setName($sessionName);
@@ -95,7 +95,7 @@ private function extractAdminPath()
9595
{
9696
$backendApp = $this->backendAppList->getCurrentApp();
9797
$cookiePath = null;
98-
$baseUrl = parse_url($this->_storeManager->getStore()->getBaseUrl(), PHP_URL_PATH);
98+
$baseUrl = parse_url($this->backendUrlFactory->create()->getBaseUrl(), PHP_URL_PATH);
9999
if (!$backendApp) {
100100
$cookiePath = $baseUrl . $this->_frontNameResolver->getFrontName();
101101
return $cookiePath;

app/code/Magento/Backend/Test/Unit/Model/Session/AdminConfigTest.php

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ class AdminConfigTest extends \PHPUnit_Framework_TestCase
2929
private $objectManager;
3030

3131
/**
32-
* @var \Magento\Store\Model\StoreManagerInterface | \PHPUnit_Framework_MockObject_MockObject
32+
* @var \Magento\Backend\Model\UrlFactory | \PHPUnit_Framework_MockObject_MockObject
3333
*/
34-
private $storeManagerMock;
34+
private $backendUrlFactory;
3535

3636
/**
3737
* @var \Magento\Framework\Filesystem|\PHPUnit_Framework_MockObject_MockObject
@@ -56,13 +56,10 @@ protected function setUp()
5656
$this->validatorFactory = $this->getMockBuilder('Magento\Framework\ValidatorFactory')
5757
->disableOriginalConstructor()
5858
->getMock();
59-
60-
$storeMock = $this->getMockBuilder('\Magento\Store\Model\Store')
61-
->disableOriginalConstructor()
62-
->getMock();
63-
$storeMock->expects($this->once())->method('getBaseUrl')->will($this->returnValue('/'));
64-
$this->storeManagerMock = $this->getMockForAbstractClass('\Magento\Store\Model\StoreManagerInterface');
65-
$this->storeManagerMock->expects($this->once())->method('getStore')->will($this->returnValue($storeMock));
59+
$backendUrl = $this->getMock('\Magento\Backend\Model\Url', [], [], '', false);
60+
$backendUrl->expects($this->once())->method('getBaseUrl')->will($this->returnValue('/'));
61+
$this->backendUrlFactory = $this->getMock('Magento\Backend\Model\UrlFactory', ['create'], [], '', false);
62+
$this->backendUrlFactory->expects($this->any())->method('create')->willReturn($backendUrl);
6663

6764
$this->filesystemMock = $this->getMock('\Magento\Framework\Filesystem', [], [], '', false);
6865
$dirMock = $this->getMockForAbstractClass('Magento\Framework\Filesystem\Directory\WriteInterface');
@@ -99,7 +96,7 @@ public function testSetCookiePathNonDefault()
9996
'validatorFactory' => $this->validatorFactory,
10097
'request' => $this->requestMock,
10198
'frontNameResolver' => $mockFrontNameResolver,
102-
'storeManager' => $this->storeManagerMock,
99+
'backendUrlFactory' => $this->backendUrlFactory,
103100
'filesystem' => $this->filesystemMock,
104101
]
105102
);
@@ -134,7 +131,7 @@ public function testSetSessionNameByConstructor()
134131
'validatorFactory' => $this->validatorFactory,
135132
'request' => $this->requestMock,
136133
'sessionName' => $sessionName,
137-
'storeManager' => $this->storeManagerMock,
134+
'backendUrlFactory' => $this->backendUrlFactory,
138135
'filesystem' => $this->filesystemMock,
139136
]
140137
);

app/code/Magento/Backend/view/adminhtml/templates/widget/form/renderer/fieldset.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if (!isset($advancedLabel)) {
2222
$advancedLabel = __('Additional Settings');
2323
}
2424

25-
$cssClass = ($isField) ? 'field ' . $element->getClass() : 'fieldset admin__fieldset' . $element->getClass();
25+
$cssClass = ($isField) ? 'field ' . $element->getClass() : 'fieldset admin__fieldset ' . $element->getClass();
2626

2727
if ($isField) {
2828
$count = $element->getCountBasicChildren();

app/code/Magento/Braintree/view/frontend/web/template/payment/cc-form.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@
8080
<!-- ko if: (isCcDetectionEnabled())-->
8181
<ul class="credit-card-types">
8282
<!-- ko foreach: {data: getCcAvailableTypesValues(), as: 'item'} -->
83-
<li class="item" data-bind="css: {_active: $parent.selectedCardType() == item.value} ">
83+
<li class="item" data-bind="css: {
84+
_active: $parent.selectedCardType() == item.value,
85+
_inactive: $parent.selectedCardType() != null && $parent.selectedCardType() != item.value
86+
} ">
8487
<!--ko if: $parent.getIcons(item.value) -->
8588
<img data-bind="attr: {
8689
'src': $parent.getIcons(item.value).url,

app/code/Magento/Catalog/etc/di.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,11 @@
494494
</argument>
495495
</arguments>
496496
</type>
497+
<type name="Magento\Catalog\Console\Command\ImagesResizeCommand">
498+
<arguments>
499+
<argument name="productRepository" xsi:type="object">Magento\Catalog\Api\ProductRepositoryInterface\Proxy</argument>
500+
</arguments>
501+
</type>
497502
<type name="Magento\Framework\Config\View">
498503
<arguments>
499504
<argument name="xpath" xsi:type="array">

app/code/Magento/Catalog/view/adminhtml/templates/catalog/category/tree.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@
466466
click: function () {
467467
(function ($) {
468468
$.ajax({
469-
url: '<?php /* @escapeNotVerified */ echo $block->getMoveUrl() ?>//',
469+
url: '<?php /* @escapeNotVerified */ echo $block->getMoveUrl() ?>',
470470
method: 'POST',
471471
data: pd.join(""),
472472
showLoader: true

app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -761,8 +761,5 @@ define([
761761
}
762762
};
763763

764-
jQuery(document).ready(function(){
765-
productConfigure = new ProductConfigure();
766-
});
767-
764+
productConfigure = new ProductConfigure();
768765
});

app/code/Magento/CatalogSearch/Model/Adapter/Mysql/Filter/Preprocessor.php

Lines changed: 64 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Magento\CatalogSearch\Model\Adapter\Mysql\Filter;
77

88
use Magento\Catalog\Model\Product;
9+
use Magento\Catalog\Model\ResourceModel\Eav\Attribute;
910
use Magento\CatalogSearch\Model\Search\TableMapper;
1011
use Magento\Eav\Model\Config;
1112
use Magento\Framework\App\ResourceConnection;
@@ -97,7 +98,7 @@ public function process(FilterInterface $filter, $isNegation, $query)
9798
*/
9899
private function processQueryWithField(FilterInterface $filter, $isNegation, $query)
99100
{
100-
/** @var \Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute */
101+
/** @var Attribute $attribute */
101102
$attribute = $this->config->getAttribute(Product::ENTITY, $filter->getField());
102103
if ($filter->getField() === 'price') {
103104
$resultQuery = str_replace(
@@ -114,24 +115,16 @@ private function processQueryWithField(FilterInterface $filter, $isNegation, $qu
114115
$this->connection->quoteIdentifier($alias . '.' . $attribute->getAttributeCode()),
115116
$query
116117
);
117-
} elseif ($filter->getType() === FilterInterface::TYPE_TERM
118-
&& in_array($attribute->getFrontendInput(), ['select', 'multiselect'], true)
118+
} elseif (
119+
$filter->getType() === FilterInterface::TYPE_TERM &&
120+
in_array($attribute->getFrontendInput(), ['select', 'multiselect'], true)
119121
) {
120-
$alias = $this->tableMapper->getMappingAlias($filter);
121-
if (is_array($filter->getValue())) {
122-
$value = sprintf(
123-
'%s IN (%s)',
124-
($isNegation ? 'NOT' : ''),
125-
implode(',', $filter->getValue())
126-
);
127-
} else {
128-
$value = ($isNegation ? '!' : '') . '= ' . $filter->getValue();
129-
}
130-
$resultQuery = sprintf(
131-
'%1$s.value %2$s',
132-
$alias,
133-
$value
134-
);
122+
$resultQuery = $this->processTermSelect($filter, $isNegation);
123+
} elseif (
124+
$filter->getType() === FilterInterface::TYPE_RANGE &&
125+
in_array($attribute->getBackendType(), ['decimal', 'int'], true)
126+
) {
127+
$resultQuery = $this->processRangeNumeric($filter, $query, $attribute);
135128
} else {
136129
$table = $attribute->getBackendTable();
137130
$select = $this->connection->select();
@@ -161,4 +154,57 @@ private function processQueryWithField(FilterInterface $filter, $isNegation, $qu
161154

162155
return $resultQuery;
163156
}
157+
158+
/**
159+
* @param FilterInterface $filter
160+
* @param string $query
161+
* @param Attribute $attribute
162+
* @return string
163+
*/
164+
private function processRangeNumeric(FilterInterface $filter, $query, $attribute)
165+
{
166+
$tableSuffix = $attribute->getBackendType() === 'decimal' ? '_decimal' : '';
167+
$table = $this->resource->getTableName("catalog_product_index_eav{$tableSuffix}");
168+
$select = $this->connection->select();
169+
170+
$currentStoreId = $this->scopeResolver->getScope()->getId();
171+
172+
$select->from(['main_table' => $table], 'entity_id')
173+
->columns([$filter->getField() => 'main_table.value'])
174+
->where('main_table.attribute_id = ?', $attribute->getAttributeId())
175+
->where('main_table.store_id = ?', $currentStoreId)
176+
->having($query);
177+
178+
$resultQuery = 'search_index.entity_id IN (
179+
select entity_id from ' . $this->conditionManager->wrapBrackets($select) . ' as filter
180+
)';
181+
182+
return $resultQuery;
183+
}
184+
185+
/**
186+
* @param FilterInterface $filter
187+
* @param bool $isNegation
188+
* @return string
189+
*/
190+
private function processTermSelect(FilterInterface $filter, $isNegation)
191+
{
192+
$alias = $this->tableMapper->getMappingAlias($filter);
193+
if (is_array($filter->getValue())) {
194+
$value = sprintf(
195+
'%s IN (%s)',
196+
($isNegation ? 'NOT' : ''),
197+
implode(',', $filter->getValue())
198+
);
199+
} else {
200+
$value = ($isNegation ? '!' : '') . '= ' . $filter->getValue();
201+
}
202+
$resultQuery = sprintf(
203+
'%1$s.value %2$s',
204+
$alias,
205+
$value
206+
);
207+
208+
return $resultQuery;
209+
}
164210
}

app/code/Magento/ConfigurableProduct/view/adminhtml/templates/product/configurable/affected-attribute-set-selector/js.phtml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@
3333
newAttributeSetContainer = $('[data-role=affected-attribute-set-new-name-container]'),
3434
existingAttributeSetContainer = $('[data-role=affected-attribute-set-existing-name-container]');
3535

36+
$form.find('input[type=text]').on('keypress',function(e){
37+
if(e.keyCode === 13){
38+
e.preventDefault();
39+
$form.closest('[data-role=modal]').find('button[data-action=confirm]').click();
40+
}
41+
});
3642

3743
$('[data-form=edit-product]').append($('<input>', {
3844
type: 'hidden',
@@ -48,6 +54,9 @@
4854
},
4955
buttons: [{
5056
text: '<?php /* @escapeNotVerified */ echo __('Confirm'); ?>',
57+
attr: {
58+
'data-action': 'confirm'
59+
},
5160
'class': 'action-secondary',
5261
click: function() {
5362
var affectedAttributeSetId = $form.find('input[name=affected-attribute-set]:checked').val();

app/code/Magento/Cookie/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-cookie",
33
"description": "N/A",
44
"require": {
5-
"php": "~5.4.11|~5.5.0|~5.6.0",
5+
"php": "~5.5.0|~5.6.0|~7.0.0",
66
"magento/module-store": "1.0.0-beta",
77
"magento/framework": "1.0.0-beta"
88
},

app/code/Magento/Customer/Console/Command/UpgradeHashAlgorithmCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ public function __construct(
4040
) {
4141
parent::__construct();
4242
$this->customerCollectionFactory = $customerCollectionFactory;
43-
$this->collection = $customerCollectionFactory->create();
4443
$this->encryptor = $encryptor;
4544
}
4645

@@ -58,6 +57,7 @@ protected function configure()
5857
*/
5958
protected function execute(InputInterface $input, OutputInterface $output)
6059
{
60+
$this->collection = $this->customerCollectionFactory->create();
6161
$this->collection->addAttributeToSelect('*');
6262
$customerCollection = $this->collection->getItems();
6363
/** @var $customer Customer */

app/code/Magento/Deploy/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-deploy",
33
"description": "N/A",
44
"require": {
5-
"php": "~5.5.0|~5.6.0",
5+
"php": "~5.5.0|~5.6.0|~7.0.0",
66
"magento/framework": "1.0.0-beta",
77
"magento/module-developer": "1.0.0-beta",
88
"magento/module-store": "1.0.0-beta",

app/code/Magento/DownloadableImportExport/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-downloadable-import-export",
33
"description": "N/A",
44
"require": {
5-
"php": "~5.5.0|~5.6.0",
5+
"php": "~5.5.0|~5.6.0|~7.0.0",
66
"magento/module-catalog": "1.0.0-beta",
77
"magento/module-import-export": "1.0.0-beta",
88
"magento/module-catalog-import-export": "1.0.0-beta",

app/code/Magento/EncryptionKey/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-encryption-key",
33
"description": "N/A",
44
"require": {
5-
"php": "~5.5.0|~5.6.0",
5+
"php": "~5.5.0|~5.6.0|~7.0.0",
66
"magento/module-config": "1.0.0-beta",
77
"magento/module-backend": "1.0.0-beta",
88
"magento/framework": "1.0.0-beta"

0 commit comments

Comments
 (0)