Skip to content

Commit 0ba5385

Browse files
committed
Merge remote-tracking branch 'origin/ACP2E-4239' into PR_2025_10_24_muntianu
2 parents e04a45c + 8c36f6f commit 0ba5385

File tree

17 files changed

+139
-329
lines changed

17 files changed

+139
-329
lines changed

app/code/Magento/Catalog/Ui/Component/Listing/Columns.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Columns extends \Magento\Ui\Component\Listing\Columns
1616
/**
1717
* Default columns max order value
1818
*/
19-
const DEFAULT_COLUMNS_MAX_ORDER = 100;
19+
public const DEFAULT_COLUMNS_MAX_ORDER = 100;
2020

2121
/**
2222
* @var \Magento\Catalog\Ui\Component\Listing\Attribute\RepositoryInterface
@@ -71,6 +71,7 @@ public function prepare()
7171
$config['sortOrder'] = ++$columnSortOrder;
7272
if ($attribute->getIsFilterableInGrid()) {
7373
$config['filter'] = $this->getFilterType($attribute->getFrontendInput());
74+
$config['userDefined'] = $attribute->getIsUserDefined();
7475
}
7576
$column = $this->columnFactory->create($attribute, $this->getContext(), $config);
7677
$column->prepare();

app/code/Magento/Cms/Model/ResourceModel/Block/Grid/Collection.php

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@
88
use Magento\Framework\Api\Search\SearchResultInterface;
99
use Magento\Framework\Api\Search\AggregationInterface;
1010
use Magento\Cms\Model\ResourceModel\Block\Collection as BlockCollection;
11-
use Magento\Framework\App\ObjectManager;
1211
use Magento\Framework\Data\Collection\Db\FetchStrategyInterface;
1312
use Magento\Framework\Data\Collection\EntityFactoryInterface;
1413
use Magento\Framework\DB\Adapter\AdapterInterface;
1514
use Magento\Framework\EntityManager\MetadataPool;
1615
use Magento\Framework\Event\ManagerInterface;
1716
use Magento\Framework\Model\ResourceModel\Db\AbstractDb;
18-
use Magento\Framework\Stdlib\DateTime\TimezoneInterface;
1917
use Magento\Store\Model\StoreManagerInterface;
2018
use Psr\Log\LoggerInterface;
2119

@@ -24,11 +22,6 @@
2422
*/
2523
class Collection extends BlockCollection implements SearchResultInterface
2624
{
27-
/**
28-
* @var TimezoneInterface
29-
*/
30-
private $timeZone;
31-
3225
/**
3326
* @var AggregationInterface
3427
*/
@@ -54,7 +47,6 @@ class Collection extends BlockCollection implements SearchResultInterface
5447
* @param string $model
5548
* @param AdapterInterface|string|null $connection
5649
* @param AbstractDb $resource
57-
* @param TimezoneInterface|null $timeZone
5850
*
5951
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
6052
*/
@@ -71,8 +63,7 @@ public function __construct(
7163
$resourceModel,
7264
$model = \Magento\Framework\View\Element\UiComponent\DataProvider\Document::class,
7365
$connection = null,
74-
?AbstractDb $resource = null,
75-
?TimezoneInterface $timeZone = null
66+
?AbstractDb $resource = null
7667
) {
7768
$this->resourceModel = $resourceModel;
7869
$this->model = $model;
@@ -90,7 +81,6 @@ public function __construct(
9081
$this->_eventObject = $eventObject;
9182
$this->_init($this->model, $this->resourceModel);
9283
$this->setMainTable($mainTable);
93-
$this->timeZone = $timeZone ?: ObjectManager::getInstance()->get(TimezoneInterface::class);
9484
}
9585

9686
/**
@@ -102,22 +92,6 @@ public function _resetState(): void
10292
$this->_init($this->model, $this->resourceModel);
10393
}
10494

105-
/**
106-
* @inheritDoc
107-
*/
108-
public function addFieldToFilter($field, $condition = null)
109-
{
110-
if ($field === 'creation_time' || $field === 'update_time') {
111-
if (is_array($condition)) {
112-
foreach ($condition as $key => $value) {
113-
$condition[$key] = $this->timeZone->convertConfigTimeToUtc($value);
114-
}
115-
}
116-
}
117-
118-
return parent::addFieldToFilter($field, $condition);
119-
}
120-
12195
/**
12296
* Get aggregation interface instance
12397
*

app/code/Magento/Cms/Model/ResourceModel/Page/Grid/Collection.php

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@
88
use Magento\Framework\Api\Search\SearchResultInterface;
99
use Magento\Framework\Api\Search\AggregationInterface;
1010
use Magento\Cms\Model\ResourceModel\Page\Collection as PageCollection;
11-
use Magento\Framework\App\ObjectManager;
1211
use Magento\Framework\Data\Collection\Db\FetchStrategyInterface;
1312
use Magento\Framework\Data\Collection\EntityFactoryInterface;
1413
use Magento\Framework\EntityManager\MetadataPool;
1514
use Magento\Framework\Event\ManagerInterface;
1615
use Magento\Framework\Model\ResourceModel\Db\AbstractDb;
17-
use Magento\Framework\Stdlib\DateTime\TimezoneInterface;
1816
use Magento\Store\Model\StoreManagerInterface;
1917
use Psr\Log\LoggerInterface;
2018

@@ -24,11 +22,6 @@
2422
*/
2523
class Collection extends PageCollection implements SearchResultInterface
2624
{
27-
/**
28-
* @var TimezoneInterface
29-
*/
30-
private $timeZone;
31-
3225
/**
3326
* @var AggregationInterface
3427
*/
@@ -54,7 +47,6 @@ class Collection extends PageCollection implements SearchResultInterface
5447
* @param string $model
5548
* @param mixed|null $connection
5649
* @param AbstractDb|null $resource
57-
* @param TimezoneInterface|null $timeZone
5850
*
5951
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
6052
*/
@@ -71,8 +63,7 @@ public function __construct(
7163
$resourceModel,
7264
$model = \Magento\Framework\View\Element\UiComponent\DataProvider\Document::class,
7365
$connection = null,
74-
?AbstractDb $resource = null,
75-
?TimezoneInterface $timeZone = null
66+
?AbstractDb $resource = null
7667
) {
7768
$this->resourceModel = $resourceModel;
7869
$this->model = $model;
@@ -90,7 +81,6 @@ public function __construct(
9081
$this->_eventObject = $eventObject;
9182
$this->_init($this->model, $this->resourceModel);
9283
$this->setMainTable($mainTable);
93-
$this->timeZone = $timeZone ?: ObjectManager::getInstance()->get(TimezoneInterface::class);
9484
}
9585

9686
/**
@@ -102,22 +92,6 @@ public function _resetState(): void
10292
$this->_init($this->model, $this->resourceModel);
10393
}
10494

105-
/**
106-
* @inheritDoc
107-
*/
108-
public function addFieldToFilter($field, $condition = null)
109-
{
110-
if ($field === 'creation_time' || $field === 'update_time') {
111-
if (is_array($condition)) {
112-
foreach ($condition as $key => $value) {
113-
$condition[$key] = $this->timeZone->convertConfigTimeToUtc($value);
114-
}
115-
}
116-
}
117-
118-
return parent::addFieldToFilter($field, $condition);
119-
}
120-
12195
/**
12296
* Get aggregation interface instance
12397
*

app/code/Magento/Customer/Model/ResourceModel/Grid/Collection.php

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@
77

88
use Magento\Customer\Model\ResourceModel\Customer;
99
use Magento\Customer\Ui\Component\DataProvider\Document;
10-
use Magento\Framework\App\ObjectManager;
1110
use Magento\Framework\Data\Collection\Db\FetchStrategyInterface as FetchStrategy;
1211
use Magento\Framework\Data\Collection\EntityFactoryInterface as EntityFactory;
1312
use Magento\Framework\Event\ManagerInterface as EventManager;
13+
use Magento\Framework\Exception\LocalizedException;
1414
use Magento\Framework\Locale\ResolverInterface;
15-
use Magento\Framework\Stdlib\DateTime\TimezoneInterface;
1615
use Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult;
1716
use Psr\Log\LoggerInterface as Logger;
1817

@@ -27,17 +26,12 @@ class Collection extends SearchResult
2726
private $localeResolver;
2827

2928
/**
30-
* @var TimezoneInterface
31-
*/
32-
private $timeZone;
33-
34-
/**
35-
* @inheritdoc
29+
* @var string
3630
*/
3731
protected $document = Document::class;
3832

3933
/**
40-
* @inheritdoc
34+
* @var array
4135
*/
4236
protected $_map = ['fields' => ['entity_id' => 'main_table.entity_id']];
4337

@@ -49,7 +43,7 @@ class Collection extends SearchResult
4943
* @param ResolverInterface $localeResolver
5044
* @param string $mainTable
5145
* @param string $resourceModel
52-
* @param TimezoneInterface|null $timeZone
46+
* @throws LocalizedException
5347
*/
5448
public function __construct(
5549
EntityFactory $entityFactory,
@@ -58,13 +52,10 @@ public function __construct(
5852
EventManager $eventManager,
5953
ResolverInterface $localeResolver,
6054
$mainTable = 'customer_grid_flat',
61-
$resourceModel = Customer::class,
62-
?TimezoneInterface $timeZone = null
55+
$resourceModel = Customer::class
6356
) {
6457
$this->localeResolver = $localeResolver;
6558
parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $mainTable, $resourceModel);
66-
$this->timeZone = $timeZone ?: ObjectManager::getInstance()
67-
->get(TimezoneInterface::class);
6859
}
6960

7061
/**
@@ -92,14 +83,6 @@ public function addFieldToFilter($field, $condition = null)
9283
return $this;
9384
}
9485

95-
if ($field === 'created_at') {
96-
if (is_array($condition)) {
97-
foreach ($condition as $key => $value) {
98-
$condition[$key] = $this->timeZone->convertConfigTimeToUtc($value);
99-
}
100-
}
101-
}
102-
10386
if (is_string($field) && count(explode('.', $field)) === 1) {
10487
$field = 'main_table.' . $field;
10588
}

app/code/Magento/Sales/Model/ResourceModel/Order/Grid/Collection.php

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
*/
66
namespace Magento\Sales\Model\ResourceModel\Order\Grid;
77

8-
use Magento\Framework\App\ObjectManager;
98
use Magento\Framework\Data\Collection\Db\FetchStrategyInterface as FetchStrategy;
109
use Magento\Framework\Data\Collection\EntityFactoryInterface as EntityFactory;
1110
use Magento\Framework\Event\ManagerInterface as EventManager;
12-
use Magento\Framework\Stdlib\DateTime\TimezoneInterface;
11+
use Magento\Framework\Exception\LocalizedException;
1312
use Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult;
1413
use Magento\Sales\Model\ResourceModel\Order;
1514
use Psr\Log\LoggerInterface as Logger;
@@ -19,11 +18,6 @@
1918
*/
2019
class Collection extends SearchResult
2120
{
22-
/**
23-
* @var TimezoneInterface
24-
*/
25-
private $timeZone;
26-
2721
/**
2822
* Initialize dependencies.
2923
*
@@ -33,20 +27,18 @@ class Collection extends SearchResult
3327
* @param EventManager $eventManager
3428
* @param string $mainTable
3529
* @param string $resourceModel
36-
* @param TimezoneInterface|null $timeZone
30+
* @throws LocalizedException
31+
* phpcs:disable Generic.CodeAnalysis.UselessOverridingMethod.Found
3732
*/
3833
public function __construct(
3934
EntityFactory $entityFactory,
4035
Logger $logger,
4136
FetchStrategy $fetchStrategy,
4237
EventManager $eventManager,
4338
$mainTable = 'sales_order_grid',
44-
$resourceModel = Order::class,
45-
?TimezoneInterface $timeZone = null
39+
$resourceModel = Order::class
4640
) {
4741
parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $mainTable, $resourceModel);
48-
$this->timeZone = $timeZone ?: ObjectManager::getInstance()
49-
->get(TimezoneInterface::class);
5042
}
5143

5244
/**
@@ -63,20 +55,4 @@ protected function _initSelect()
6355

6456
return $this;
6557
}
66-
67-
/**
68-
* @inheritDoc
69-
*/
70-
public function addFieldToFilter($field, $condition = null)
71-
{
72-
if ($field === 'created_at') {
73-
if (is_array($condition)) {
74-
foreach ($condition as $key => $value) {
75-
$condition[$key] = $this->timeZone->convertConfigTimeToUtc($value);
76-
}
77-
}
78-
}
79-
80-
return parent::addFieldToFilter($field, $condition);
81-
}
8258
}

app/code/Magento/Sales/Plugin/Model/ResourceModel/Order/OrderGridCollectionFilter.php

Lines changed: 0 additions & 84 deletions
This file was deleted.

0 commit comments

Comments
 (0)