Skip to content

Commit 447a24d

Browse files
🔃 [EngCom] Public Pull Requests - 2.3-develop
Accepted Public Pull Requests: - #14183: [Forwardport] Fix product attribute ordering when more than 10 attributes (by @rostyslav-hymon) - #14179: [Forwardport] Fix for Issue-13556 - Sorting in Product Listing via Quantity not work (by @dimonovp) - #14182: [Forwardport] Fix faulty admin spinner animation (by @dimonovp) - #14180: [Forwardport] Act better on existing input focus instead of removing it (by @mastiuhin-olexandr) - #14178: [Forwardport] Minicart should require dropdownDialog (by @rostyslav-hymon) - #14177: [Forwardport] Default Welcome message is broken on storefront with enabled translate-inline (by @dimonovp) - #14174: [Forwardport] Solved this issue : Drop down values are not showing in catalog produ� (by @dimonovp) - #14165: [Forwardport 2.3] Added mage/translate component to customers's ajax login (by @ccasciotti) - #13885: #5463 - Use specified hashing algo in \Magento\Framework\Encryption\Encryptor::getHash (by @k4emic) - #14158: Improve Customer GraphQL Model code quality (by @elzekool) Fixed GitHub Issues: - #13556: Sorting in Product Listing via Quantity not work (reported by @LordHansolo) has been fixed in #14179 by @dimonovp in 2.3-develop branch Related commits: 1. ce6dd85 2. a6dc79a 3. bcb553c 4. 551fa25 - #13988: Mini search field looses focus after its JavaScript is initialized (reported by @krzksz) has been fixed in #14180 by @mastiuhin-olexandr in 2.3-develop branch Related commits: 1. 2f624a4 - #12711: Default Welcome message is broken on storefront with enabled translate-inline (reported by @alena-marchenko) has been fixed in #14177 by @dimonovp in 2.3-develop branch Related commits: 1. 4147b53 2. 0610449 3. 5367c47 - #13006: Drop down values are not showing in catalog product grid magento2 (reported by @ramusadwika) has been fixed in #14174 by @dimonovp in 2.3-develop branch Related commits: 1. 80887ac - #5463: The ability to store passwords using different hashing algorithms is limited (reported by @maderlock) has been fixed in #13885 by @k4emic in 2.3-develop branch Related commits: 1. d537d56
2 parents 620d37d + 43e65fa commit 447a24d

File tree

14 files changed

+114
-16
lines changed

14 files changed

+114
-16
lines changed

app/code/Magento/CatalogInventory/Model/Source/Stock.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,23 @@ public function getAllOptions()
2626
['value' => \Magento\CatalogInventory\Model\Stock::STOCK_OUT_OF_STOCK, 'label' => __('Out of Stock')]
2727
];
2828
}
29+
30+
/**
31+
* Add Value Sort To Collection Select.
32+
*
33+
* @param \Magento\Eav\Model\Entity\Collection\AbstractCollection $collection
34+
* @param string $dir
35+
*
36+
* @return $this
37+
*/
38+
public function addValueSortToCollection($collection, $dir = \Magento\Framework\Data\Collection::SORT_ORDER_DESC)
39+
{
40+
$collection->getSelect()->joinLeft(
41+
['stock_item_table' => 'cataloginventory_stock_item'],
42+
"e.entity_id=stock_item_table.product_id",
43+
[]
44+
);
45+
$collection->getSelect()->order("stock_item_table.qty $dir");
46+
return $this;
47+
}
2948
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\CatalogInventory\Test\Unit\Model\Source;
8+
9+
use PHPUnit\Framework\TestCase;
10+
11+
class StockTest extends TestCase
12+
{
13+
/**
14+
* @var \Magento\CatalogInventory\Model\Source\Stock
15+
*/
16+
private $model;
17+
18+
protected function setUp()
19+
{
20+
$this->model = new \Magento\CatalogInventory\Model\Source\Stock();
21+
}
22+
23+
public function testAddValueSortToCollection()
24+
{
25+
$selectMock = $this->createMock(\Magento\Framework\DB\Select::class);
26+
$collectionMock = $this->createMock(\Magento\Eav\Model\Entity\Collection\AbstractCollection::class);
27+
$collectionMock->expects($this->atLeastOnce())->method('getSelect')->willReturn($selectMock);
28+
29+
$selectMock->expects($this->once())
30+
->method('joinLeft')
31+
->with(
32+
['stock_item_table' => 'cataloginventory_stock_item'],
33+
"e.entity_id=stock_item_table.product_id",
34+
[]
35+
)
36+
->willReturnSelf();
37+
$selectMock->expects($this->once())
38+
->method('order')
39+
->with("stock_item_table.qty DESC")
40+
->willReturnSelf();
41+
42+
$this->model->addValueSortToCollection($collectionMock);
43+
}
44+
}

app/code/Magento/Checkout/view/frontend/web/js/view/minicart.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ define([
1010
'ko',
1111
'underscore',
1212
'sidebar',
13-
'mage/translate'
13+
'mage/translate',
14+
'mage/dropdown'
1415
], function (Component, customerData, $, ko, _) {
1516
'use strict';
1617

app/code/Magento/Customer/view/frontend/web/js/action/login.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ define([
77
'jquery',
88
'mage/storage',
99
'Magento_Ui/js/model/messageList',
10-
'Magento_Customer/js/customer-data'
11-
], function ($, storage, globalMessageList, customerData) {
10+
'Magento_Customer/js/customer-data',
11+
'mage/translate'
12+
], function ($, storage, globalMessageList, customerData, $t) {
1213
'use strict';
1314

1415
var callbacks = [],
@@ -48,7 +49,7 @@ define([
4849
}
4950
}).fail(function () {
5051
messageContainer.addErrorMessage({
51-
'message': 'Could not authenticate. Please try again later'
52+
'message': $t('Could not authenticate. Please try again later')
5253
});
5354
callbacks.forEach(function (callback) {
5455
callback(loginData);

app/code/Magento/CustomerGraphQl/Model/Resolver/Customer.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66

77
namespace Magento\CustomerGraphQl\Model\Resolver;
88

9+
use Magento\Authorization\Model\UserContextInterface;
10+
use Magento\CustomerGraphQl\Model\Resolver\Customer\CustomerDataProvider;
911
use Magento\Framework\Exception\NoSuchEntityException;
1012
use Magento\Framework\GraphQl\Exception\GraphQlAuthorizationException;
1113
use Magento\Framework\GraphQl\Exception\GraphQlNoSuchEntityException;
1214
use Magento\GraphQl\Model\ResolverInterface;
13-
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
1415
use Magento\GraphQl\Model\ResolverContextInterface;
1516

1617
/**
@@ -24,10 +25,10 @@ class Customer implements ResolverInterface
2425
private $customerResolver;
2526

2627
/**
27-
* @param \Magento\CustomerGraphQl\Model\Resolver\Customer\CustomerDataProvider $customerResolver
28+
* @param CustomerDataProvider $customerResolver
2829
*/
2930
public function __construct(
30-
\Magento\CustomerGraphQl\Model\Resolver\Customer\CustomerDataProvider $customerResolver
31+
CustomerDataProvider $customerResolver
3132
) {
3233
$this->customerResolver = $customerResolver;
3334
}
@@ -37,7 +38,7 @@ public function __construct(
3738
*/
3839
public function resolve(array $args, ResolverContextInterface $context)
3940
{
40-
if ((!$context->getUserId()) || $context->getUserType() == 4) {
41+
if ((!$context->getUserId()) || $context->getUserType() == UserContextInterface::USER_TYPE_GUEST) {
4142
throw new GraphQlAuthorizationException(
4243
__(
4344
'Current customer does not have access to the resource "%1"',

app/code/Magento/CustomerGraphQl/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"require": {
77
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
88
"magento/module-customer": "100.2.*",
9+
"magento/module-authorization": "100.3.*",
910
"magento/module-graph-ql": "100.0.*",
1011
"magento/framework": "100.3.*"
1112
},

app/code/Magento/CustomerGraphQl/etc/module.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<module name="Magento_CustomerGraphQl" >
1010
<sequence>
1111
<module name="Magento_Customer"/>
12+
<module name="Magento_Authorization"/>
1213
<module name="Magento_GraphQl"/>
1314
</sequence>
1415
</module>

app/code/Magento/Eav/Model/ResourceModel/Entity/Attribute/Option.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ public function addOptionValueToCollection($collection, $attribute, $valueExpr)
4444
);
4545
$valueExpr = $connection->getCheckSql(
4646
"{$optionTable2}.value_id IS NULL",
47-
"{$optionTable1}.value",
48-
"{$optionTable2}.value"
47+
"{$optionTable1}.option_id",
48+
"{$optionTable2}.option_id"
4949
);
5050

5151
$collection->getSelect()->joinLeft(

app/code/Magento/Search/view/frontend/web/form-mini.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ define([
9898
}, this), 250);
9999
}, this));
100100

101-
this.element.trigger('blur');
101+
if (this.element.get(0) === document.activeElement) {
102+
this.setActiveState(true);
103+
}
102104

103105
this.element.on('focus', this.setActiveState.bind(this, true));
104106
this.element.on('keydown', this._onKeyDown);

app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ define([
312312
*/
313313
_sortAttributes: function () {
314314
this.options.jsonConfig.attributes = _.sortBy(this.options.jsonConfig.attributes, function (attribute) {
315-
return attribute.position;
315+
return parseInt(attribute.position, 10);
316316
});
317317
},
318318

0 commit comments

Comments
 (0)