Skip to content

Commit 622f913

Browse files
🔃 [EngCom] Public Pull Requests - 2.3-develop
Accepted Public Pull Requests: - #16932: Removed unused interface reference (by @jochhop) - magento/graphql-ce#112: Added breadcrumbs support (by @vovsky) - #16926: Fixed typo mistake in testsuite (by @mage2pratik) - #16609: [Forwardport] Create ability to set is_visible_on_front to order status history comment (by @gelanivishal) - #16814: [Forwardport] 15863: [Forwardport] Refactored javascript code of admin notification modal popup (by @mage2pratik) - #16796: [Forwardport] Resolved : no navigation-level0-item__hover__color #15848 (by @hitesh-wagento) - magento/graphql-ce#103: hidden product attributes not intended for storefront (by @vovsky) - #16741: [Forwardport] [Fix] forgot to add lowercase conversion on grouped product assignation (by @hitesh-wagento) - #16742: [Forwardport] Fix for GitHub issue #14035. (by @eduard13) - #16715: [Port 2.3] Add indexes to timestamp field in oauth_nonce (by @rogyar) - #16666: [Forwardport] Customer group extension attributes not carried over on save (by @mageprince) Fixed GitHub Issues: - #15590: Typo in tests / setCateroryIds([]) (reported by @kmddevdani) has been fixed in #16926 by @mage2pratik in 2.3-develop branch Related commits: 1. 77c5e85 - #15848: no navigation-level0-item__hover__color (reported by @DanielRuf) has been fixed in #16796 by @hitesh-wagento in 2.3-develop branch Related commits: 1. 85caf63 - #14035: Magento REST API, wrong condition for product list category filter (reported by @kamilszewczyk) has been fixed in #16742 by @eduard13 in 2.3-develop branch Related commits: 1. 9fb7323 2. 69c9a63 3. 1128446 - #10346: Deadlock occurs using REST API & OAuth 1.0a under high concurrency (reported by @careys7) has been fixed in #16715 by @rogyar in 2.3-develop branch Related commits: 1. a27fc6e
2 parents 6f0e5e5 + 356bea9 commit 622f913

File tree

28 files changed

+272
-49
lines changed

28 files changed

+272
-49
lines changed

app/code/Magento/AdminNotification/view/adminhtml/templates/system/messages/popup.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
{
2424
"[data-role=system_messages_list]": {
2525
"Magento_AdminNotification/js/system/messages/popup": {
26-
class: 'modal-system-messages ui-popup-message'
26+
"class":"modal-system-messages ui-popup-message"
2727
}
2828
}
2929
}
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
/**
22
* Copyright © Magento, Inc. All rights reserved.
33
* See COPYING.txt for license details.
4-
*/
4+
*/
55

66
define([
77
'jquery',
88
'Magento_Ui/js/modal/modal'
9-
], function ($) {
9+
], function ($, modal) {
1010
'use strict';
1111

1212
return function (data, element) {
13-
if (this.modal) {
14-
this.modal.html($(element).html());
13+
14+
if (modal.modal) {
15+
modal.modal.html($(element).html());
1516
} else {
16-
this.modal = $(element).modal({
17+
modal.modal = $(element).modal({
1718
modalClass: data.class,
1819
type: 'popup',
1920
buttons: []
2021
});
2122
}
22-
this.modal.modal('openModal');
23+
24+
modal.modal.modal('openModal');
2325
};
2426
});

app/code/Magento/Catalog/Model/Api/SearchCriteria/CollectionProcessor/FilterProcessor/ProductCategoryFilter.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,13 @@ class ProductCategoryFilter implements CustomFilterInterface
2121
*/
2222
public function apply(Filter $filter, AbstractDb $collection)
2323
{
24-
$conditionType = $filter->getConditionType() ?: 'eq';
25-
$categoryFilter = [$conditionType => [$filter->getValue()]];
24+
$value = $filter->getValue();
25+
$conditionType = $filter->getConditionType() ?: 'in';
26+
$filterValue = [$value];
27+
if (($conditionType === 'in' || $conditionType === 'nin') && is_string($value)) {
28+
$filterValue = explode(',', $value);
29+
}
30+
$categoryFilter = [$conditionType => $filterValue];
2631

2732
/** @var Collection $collection */
2833
$collection->addCategoriesFilter($categoryFilter);

app/code/Magento/Catalog/Test/Unit/Model/Api/SearchCriteria/CollectionProcessor/FilterProcessor/ProductCategoryFilterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function testApplyWithoutCondition()
6666

6767
$collectionMock->expects($this->once())
6868
->method('addCategoriesFilter')
69-
->with(['eq' => ['value']]);
69+
->with(['in' => ['value']]);
7070

7171
$this->assertTrue($this->model->apply($filterMock, $collectionMock));
7272
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\CatalogGraphQl\Model\Resolver\Category;
9+
10+
use \Magento\CatalogGraphQl\Model\Resolver\Category\DataProvider\Breadcrumbs as BreadcrumbsDataProvider;
11+
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
12+
use Magento\Framework\GraphQl\Config\Element\Field;
13+
use Magento\Framework\GraphQl\Query\ResolverInterface;
14+
use Magento\Framework\GraphQl\Query\Resolver\Value;
15+
use Magento\Framework\GraphQl\Query\Resolver\ValueFactory;
16+
17+
/**
18+
* Retrieves breadcrumbs
19+
*/
20+
class Breadcrumbs implements ResolverInterface
21+
{
22+
/**
23+
* @var BreadcrumbsDataProvider
24+
*/
25+
private $breadcrumbsDataProvider;
26+
27+
/**
28+
* @var ValueFactory
29+
*/
30+
private $valueFactory;
31+
32+
/**
33+
* @param BreadcrumbsDataProvider $breadcrumbsDataProvider
34+
* @param ValueFactory $valueFactory
35+
*/
36+
public function __construct(
37+
BreadcrumbsDataProvider $breadcrumbsDataProvider,
38+
ValueFactory $valueFactory
39+
) {
40+
$this->breadcrumbsDataProvider = $breadcrumbsDataProvider;
41+
$this->valueFactory = $valueFactory;
42+
}
43+
44+
/**
45+
* @inheritdoc
46+
*/
47+
public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null): Value
48+
{
49+
if (!isset($value['path'])) {
50+
$result = function () {
51+
return null;
52+
};
53+
return $this->valueFactory->create($result);
54+
}
55+
56+
$result = function () use ($value) {
57+
$breadcrumbsData = $this->breadcrumbsDataProvider->getData($value['path']);
58+
return count($breadcrumbsData) ? $breadcrumbsData : null;
59+
};
60+
return $this->valueFactory->create($result);
61+
}
62+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\CatalogGraphQl\Model\Resolver\Category\DataProvider;
9+
10+
use Magento\Catalog\Model\ResourceModel\Category\CollectionFactory;
11+
12+
/**
13+
* Breadcrumbs data provider
14+
*/
15+
class Breadcrumbs
16+
{
17+
/**
18+
* @var CollectionFactory
19+
*/
20+
private $collectionFactory;
21+
22+
/**
23+
* @param CollectionFactory $collectionFactory
24+
*/
25+
public function __construct(
26+
CollectionFactory $collectionFactory
27+
) {
28+
$this->collectionFactory = $collectionFactory;
29+
}
30+
31+
/**
32+
* @param string $categoryPath
33+
* @return array
34+
*/
35+
public function getData(string $categoryPath): array
36+
{
37+
$breadcrumbsData = [];
38+
39+
$pathCategoryIds = explode('/', $categoryPath);
40+
$parentCategoryIds = array_slice($pathCategoryIds, 2, -1);
41+
42+
if (count($parentCategoryIds)) {
43+
$collection = $this->collectionFactory->create();
44+
$collection->addAttributeToSelect(['name', 'url_key']);
45+
$collection->addAttributeToFilter('entity_id', $parentCategoryIds);
46+
47+
foreach ($collection as $category) {
48+
$breadcrumbsData[] = [
49+
'category_id' => $category->getId(),
50+
'category_name' => $category->getName(),
51+
'category_level' => $category->getLevel(),
52+
'category_url_key' => $category->getUrlKey(),
53+
];
54+
}
55+
}
56+
return $breadcrumbsData;
57+
}
58+
}

app/code/Magento/CatalogGraphQl/Model/Resolver/Products/Attributes/Collection.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,24 @@ public function getAttributes() : AttributeCollection
4646
$this->collection = $this->collectionFactory->create();
4747
$this->collection->addFieldToFilter('is_user_defined', '1');
4848
$this->collection->addFieldToFilter('attribute_code', ['neq' => 'cost']);
49+
$this->collection->addFieldToFilter(
50+
[
51+
'is_comparable',
52+
'is_filterable',
53+
'is_filterable_in_search',
54+
'is_visible_on_front',
55+
'used_in_product_listing',
56+
'used_for_sort_by'
57+
],
58+
[
59+
['eq' => '1'],
60+
['eq' => '1'],
61+
['eq' => '1'],
62+
['eq' => '1'],
63+
['eq' => '1'],
64+
['eq' => '1']
65+
]
66+
);
4967
}
5068

5169
return $this->collection->load();

app/code/Magento/CatalogGraphQl/etc/schema.graphqls

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,14 @@ interface CategoryInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model
381381
currentPage: Int = 1 @doc(description: "Specifies which page of results to return. The default value is 1."),
382382
sort: ProductSortInput @doc(description: "Specifies which attribute to sort on, and whether to return the results in ascending or descending order.")
383383
): CategoryProducts @doc(description: "The list of products assigned to the category") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Category\\Products")
384+
breadcrumbs: [Breadcrumb] @doc(description: "Breadcrumbs, parent categories info") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Category\\Breadcrumbs")
385+
}
386+
387+
type Breadcrumb @doc(description: "Breadcrumb item"){
388+
category_id: Int @doc(description: "Category ID")
389+
category_name: String @doc(description: "Category name")
390+
category_level: Int @doc(description: "Category level")
391+
category_url_key: String @doc(description: "Category URL key")
384392
}
385393

386394
type CustomizableRadioOption implements CustomizableOptionInterface @doc(description: "CustomizableRadioOption contains information about a set of radio buttons that are defined as part of a customizable option") {

app/code/Magento/Customer/Model/ResourceModel/GroupRepository.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ public function save(\Magento\Customer\Api\Data\GroupInterface $group)
156156
->setCode($groupModel->getCode())
157157
->setTaxClassId($groupModel->getTaxClassId())
158158
->setTaxClassName($groupModel->getTaxClassName());
159+
160+
if ($group->getExtensionAttributes()) {
161+
$groupDataObject->setExtensionAttributes($group->getExtensionAttributes());
162+
}
163+
159164
return $groupDataObject;
160165
}
161166

app/code/Magento/Customer/Model/Visitor.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
namespace Magento\Customer\Model;
88

9-
use Magento\Framework\Indexer\StateInterface;
10-
119
/**
1210
* Class Visitor
1311
* @package Magento\Customer\Model

0 commit comments

Comments
 (0)