Skip to content

Commit 16e22c5

Browse files
🔃 [Magento Community Engineering] Community Contributions - 2.4-develop daily delivery
Accepted Community Pull Requests: - #26523: [#25963] Fixed grids export: option labels are taken from grid filters and columns now. (by @novikor) - #25321: Changing input phone type to tel in Contact, Error Report and Customer widget pages (by @rafaelstz) - #26761: [Analytics] Code refactor & covered unit test in Analytics/ReportXml/QueryFactory (by @srsathish92) - #22296: Fix #14958 - remove sales sequence data on store view delete (by @Bartlomiejsz) - #26904: [Layout] Adding 'article' as an additional supported layout tag (by @eduard13) - #26701: Date incorrect on pdf invoice issue26675 (by @edenduong) - #26897: Swatches options: eliminate objects instantiation since only their data needed (by @ilnytskyi) - #26584: #26583 Tier pricing save percent showing logic updated in product detail page (by @srsathish92) - #26418: [Fixed Compare Products section not showing in mobile view under 767px] (by @hitesh-wagento) - #25626: Fix translation retrieval (by @brosenberger) - #26710: [Customer] Fixing the code style for account edit template and Integration test (by @eduard13) - #26899: Unit test for Magento\Vault\Plugin\PaymentVaultAttributesLoad (by @karyna-tsymbal-atwix) - #25806: Reflection: Fix null as first return type (by @Parakoopa) - #25426: Ui: log exception correctly (by @bchatard) - #26863: TierPriceBox toHtml method should be return with string (by @tufahu) - #26894: Unit test for Magento\GiftMessage\Model\Plugin\MergeQuoteItems (by @karyna-tsymbal-atwix) - #26878: [NewRelicReporting] Covering the New Relic plugins by Unit Tests (by @eduard13) - #26617: Unit Test for Magento\LayeredNavigation\Observer\Edit\Tab\Front\ProductAttributeFormBuildFrontTabObserver (by @karyna-tsymbal-atwix) - #26650: issue-#25675 Added fix for #25675 issue to the 2.4 Magento version (by @molneek) - #26790: Disabled flat: cast $attributeId as (int) in selects (by @ilnytskyi) - #25417: README > Improving the apresentation (by @rafaelstz) - #24976: Fix doc block for $queueIterator Magento\Framework\MessageQueue\Topology\Config (by @UncleTioma) - #26869: Update MockObject class in Widget module (by @hws47a) - #26868: Update MockObject class in Wishlist module (by @hws47a) Fixed GitHub Issues: - #25963: Grid Export rendered data is not reflecting in the exported File, Displayed ID instead of Rendered Label (reported by @koushikch7) has been fixed in #26523 by @novikor in 2.4-develop branch Related commits: 1. b43980b 2. 93793d8 3. c517f5f 4. 9bb416f 5. cd24e41 6. 6b434ba 7. b117b0c 8. 4a78ca5 9. 34d1876 10. 4483911 11. 0d3e478 12. 1a1ab4d 13. 5849cb6 - #14958: sale_sequence_* records are not removed on store view deletion (reported by @llzard) has been fixed in #22296 by @Bartlomiejsz in 2.4-develop branch Related commits: 1. 8529467 2. 4c4ae53 3. 774d40f 4. 8dab9d7 5. 4385c2f 6. 78bfbc8 7. 3ff5c06 8. 85b0730 9. 309a25f 10. c83a283 11. 328bc51 12. 7c078cf 13. 76b2085 14. 11f013c 15. 68d1bed 16. 48f213d 17. 6458cc8 18. 94b6a17 19. f894321 - #26675: Date incorrect on pdf invoice (reported by @devchris79) has been fixed in #26701 by @edenduong in 2.4-develop branch Related commits: 1. 5ebb43b - #26583: Product Detail Page - Tier price (fixed & discount) save percentage displaying wrong calculation (reported by @srsathish92) has been fixed in #26584 by @srsathish92 in 2.4-develop branch Related commits: 1. 9c11369 2. 00317ef 3. ecc4ef5 4. 24b3fba 5. 62f8c6c 6. 0110496 7. 4680f70 8. 0216e5e - #26416: Compare Products section not showing in mobile view under 767px (reported by @hitesh-wagento) has been fixed in #26418 by @hitesh-wagento in 2.4-develop branch Related commits: 1. 1aed73e 2. f88223a 3. e90a4a1 - #25656: M2.3.2 : Nullable getters in Service Contracts will throw a reflection error when used in the web API (reported by @kanduvisla) has been fixed in #25806 by @Parakoopa in 2.4-develop branch Related commits: 1. 0cea191 2. 99a1a98 3. 253f881 4. 7e3390d - #25675: Unable add product to cart in Magento 2.3.3 backend when stock quantity is 1 - "The requested qty is not available" (reported by @wibbel) has been fixed in #26650 by @molneek in 2.4-develop branch Related commits: 1. e088db1 - #24971: Incorrect @var reference in docBlock of a class member variable (reported by @salmanazeez786) has been fixed in #24976 by @UncleTioma in 2.4-develop branch Related commits: 1. 4c23a16 2. acb45f6
2 parents 23fdbe4 + bc5c517 commit 16e22c5

File tree

114 files changed

+2705
-1105
lines changed

Some content is hidden

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

114 files changed

+2705
-1105
lines changed

README.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
1-
[![Open Source Helpers](https://www.codetriage.com/magento/magento2/badges/users.svg)](https://www.codetriage.com/magento/magento2)
2-
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/magento/magento2?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
3-
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/magento-2/localized.svg)](https://crowdin.com/project/magento-2)
1+
<p align="center">
2+
<a href="https://magento.com">
3+
<img src="https://static.magento.com/sites/all/themes/magento/logo.svg" width="300px" alt="Magento" />
4+
</a>
5+
</p>
6+
<p align="center">
7+
<br /><br />
8+
<a href="https://www.codetriage.com/magento/magento2">
9+
<img src="https://www.codetriage.com/magento/magento2/badges/users.svg" alt="Open Source Helpers" />
10+
</a>
11+
<a href="https://gitter.im/magento/magento2?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge">
12+
<img src="https://badges.gitter.im/Join%20Chat.svg" alt="Gitter" />
13+
</a>
14+
<a href="https://crowdin.com/project/magento-2">
15+
<img src="https://d322cqt584bo4o.cloudfront.net/magento-2/localized.svg" alt="Crowdin" />
16+
</a>
17+
</p>
418

519
## Welcome
620
Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a cutting-edge, feature-rich eCommerce solution that gets results.

app/code/Magento/Analytics/ReportXml/QueryFactory.php

Lines changed: 50 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
67
namespace Magento\Analytics\ReportXml;
78

89
use Magento\Analytics\ReportXml\DB\SelectBuilderFactory;
910
use Magento\Framework\App\CacheInterface;
11+
use Magento\Framework\DB\Select;
1012
use Magento\Framework\ObjectManagerInterface;
13+
use Magento\Framework\Serialize\Serializer\Json;
1114

1215
/**
1316
* Creates Query object according to configuration
17+
*
1418
* Factory for @see \Magento\Analytics\ReportXml\Query
1519
*/
1620
class QueryFactory
@@ -45,6 +49,11 @@ class QueryFactory
4549
*/
4650
private $selectHydrator;
4751

52+
/**
53+
* @var Json
54+
*/
55+
private $jsonSerializer;
56+
4857
/**
4958
* QueryFactory constructor.
5059
*
@@ -54,21 +63,24 @@ class QueryFactory
5463
* @param SelectBuilderFactory $selectBuilderFactory
5564
* @param Config $config
5665
* @param array $assemblers
66+
* @param Json $jsonSerializer
5767
*/
5868
public function __construct(
5969
CacheInterface $queryCache,
6070
SelectHydrator $selectHydrator,
6171
ObjectManagerInterface $objectManager,
6272
SelectBuilderFactory $selectBuilderFactory,
6373
Config $config,
64-
array $assemblers
74+
array $assemblers,
75+
Json $jsonSerializer
6576
) {
6677
$this->config = $config;
6778
$this->selectBuilderFactory = $selectBuilderFactory;
6879
$this->assemblers = $assemblers;
6980
$this->queryCache = $queryCache;
7081
$this->objectManager = $objectManager;
7182
$this->selectHydrator = $selectHydrator;
83+
$this->jsonSerializer = $jsonSerializer;
7284
}
7385

7486
/**
@@ -101,14 +113,10 @@ private function constructQuery($queryName)
101113
$selectBuilder = $assembler->assemble($selectBuilder, $queryConfig);
102114
}
103115
$select = $selectBuilder->create();
104-
return $this->objectManager->create(
105-
Query::class,
106-
[
107-
'select' => $select,
108-
'selectHydrator' => $this->selectHydrator,
109-
'connectionName' => $selectBuilder->getConnectionName(),
110-
'config' => $queryConfig
111-
]
116+
return $this->createQueryObject(
117+
$select,
118+
$selectBuilder->getConnectionName(),
119+
$queryConfig
112120
);
113121
}
114122

@@ -122,19 +130,42 @@ public function create($queryName)
122130
{
123131
$cached = $this->queryCache->load($queryName);
124132
if ($cached) {
125-
$queryData = json_decode($cached, true);
126-
return $this->objectManager->create(
127-
Query::class,
128-
[
129-
'select' => $this->selectHydrator->recreate($queryData['select_parts']),
130-
'selectHydrator' => $this->selectHydrator,
131-
'connectionName' => $queryData['connectionName'],
132-
'config' => $queryData['config']
133-
]
133+
$queryData = $this->jsonSerializer->unserialize($cached);
134+
return $this->createQueryObject(
135+
$this->selectHydrator->recreate($queryData['select_parts']),
136+
$queryData['connectionName'],
137+
$queryData['config']
134138
);
135139
}
136140
$query = $this->constructQuery($queryName);
137-
$this->queryCache->save(json_encode($query), $queryName);
141+
$this->queryCache->save(
142+
$this->jsonSerializer->serialize($query),
143+
$queryName
144+
);
138145
return $query;
139146
}
147+
148+
/**
149+
* Create query class using objectmanger
150+
*
151+
* @param Select $select
152+
* @param string $connection
153+
* @param array $queryConfig
154+
* @return Query
155+
*/
156+
private function createQueryObject(
157+
Select $select,
158+
string $connection,
159+
array $queryConfig
160+
) {
161+
return $this->objectManager->create(
162+
Query::class,
163+
[
164+
'select' => $select,
165+
'selectHydrator' => $this->selectHydrator,
166+
'connectionName' => $connection,
167+
'config' => $queryConfig
168+
]
169+
);
170+
}
140171
}

0 commit comments

Comments
 (0)