Skip to content

Commit 0934216

Browse files
committed
Merge branch '2.4-develop' of https://github.com/magento-gl/magento2ce into ACP2E-242
2 parents 398a04b + 1f69f02 commit 0934216

File tree

37 files changed

+3244
-91
lines changed

37 files changed

+3244
-91
lines changed

app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductWithMediaThumbGallerySliderTest.xml

Lines changed: 272 additions & 0 deletions
Large diffs are not rendered by default.

app/code/Magento/CatalogSearch/Block/Advanced/Form.php

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,11 @@
2626
class Form extends Template
2727
{
2828
/**
29-
* Currency factory
30-
*
3129
* @var CurrencyFactory
3230
*/
3331
protected $_currencyFactory;
3432

3533
/**
36-
* Catalog search advanced
37-
*
3834
* @var Advanced
3935
*/
4036
protected $_catalogSearchAdvanced;
@@ -125,15 +121,12 @@ public function getAttributeValidationClass($attribute)
125121
public function getAttributeValue($attribute, $part = null)
126122
{
127123
$value = $this->getRequest()->getQuery($attribute->getAttributeCode());
124+
128125
if ($part && $value) {
129-
if (isset($value[$part])) {
130-
$value = $value[$part];
131-
} else {
132-
$value = '';
133-
}
126+
$value = $value[$part] ?? '';
134127
}
135128

136-
return $value;
129+
return is_array($value) ? '' : $value;
137130
}
138131

139132
/**

app/code/Magento/CatalogSearch/Model/Advanced.php

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -51,65 +51,47 @@
5151
class Advanced extends \Magento\Framework\Model\AbstractModel
5252
{
5353
/**
54-
* User friendly search criteria list
55-
*
5654
* @var array
5755
*/
5856
protected $_searchCriterias = [];
5957

6058
/**
61-
* Product collection
62-
*
6359
* @var ProductCollection
6460
*/
6561
protected $_productCollection;
6662

6763
/**
68-
* Initialize dependencies
69-
*
7064
* @deprecated 101.0.2
7165
* @var Config
7266
*/
7367
protected $_catalogConfig;
7468

7569
/**
76-
* Catalog product visibility
77-
*
7870
* @var Visibility
7971
*/
8072
protected $_catalogProductVisibility;
8173

8274
/**
83-
* Attribute collection factory
84-
*
8575
* @var AttributeCollectionFactory
8676
*/
8777
protected $_attributeCollectionFactory;
8878

8979
/**
90-
* Store manager
91-
*
9280
* @var \Magento\Store\Model\StoreManagerInterface
9381
*/
9482
protected $_storeManager;
9583

9684
/**
97-
* Product factory
98-
*
9985
* @var ProductFactory
10086
*/
10187
protected $_productFactory;
10288

10389
/**
104-
* Currency factory
105-
*
10690
* @var CurrencyFactory
10791
*/
10892
protected $_currencyFactory;
10993

11094
/**
111-
* Advanced Collection Factory
112-
*
11395
* @deprecated
11496
* @see $collectionProvider
11597
* @var ProductCollectionFactory
@@ -197,12 +179,15 @@ public function addFilters($values)
197179
if (!isset($values[$attribute->getAttributeCode()])) {
198180
continue;
199181
}
200-
if ($attribute->getFrontendInput() == 'text' || $attribute->getFrontendInput() == 'textarea') {
201-
if (!trim($values[$attribute->getAttributeCode()])) {
202-
continue;
203-
}
204-
}
182+
205183
$value = $values[$attribute->getAttributeCode()];
184+
185+
if (($attribute->getFrontendInput() == 'text' || $attribute->getFrontendInput() == 'textarea')
186+
&& (!is_string($value) || !trim($value))
187+
) {
188+
continue;
189+
}
190+
206191
$preparedSearchValue = $this->getPreparedSearchCriteria($attribute, $value);
207192
if (false === $preparedSearchValue) {
208193
continue;

app/code/Magento/CatalogUrlRewrite/Model/ResourceModel/Category/Product.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ class Product extends AbstractDb
1919
/**
2020
* Product/Category relation table name
2121
*/
22-
const TABLE_NAME = 'catalog_url_rewrite_product_category';
22+
public const TABLE_NAME = 'catalog_url_rewrite_product_category';
2323

2424
/**
2525
* Chunk for mass insert
2626
*/
27-
const CHUNK_SIZE = 100;
27+
public const CHUNK_SIZE = 100;
2828

2929
/**
3030
* Primary key auto increment flag
@@ -53,12 +53,12 @@ public function saveMultiple(array $insertData)
5353
{
5454
$connection = $this->getConnection();
5555
if (count($insertData) <= self::CHUNK_SIZE) {
56-
return $connection->insertMultiple($this->getTable(self::TABLE_NAME), $insertData);
56+
return $connection->insertOnDuplicate($this->getTable(self::TABLE_NAME), $insertData);
5757
}
5858
$data = array_chunk($insertData, self::CHUNK_SIZE);
5959
$totalCount = 0;
6060
foreach ($data as $insertData) {
61-
$totalCount += $connection->insertMultiple($this->getTable(self::TABLE_NAME), $insertData);
61+
$totalCount += $connection->insertOnDuplicate($this->getTable(self::TABLE_NAME), $insertData);
6262
}
6363
return $totalCount;
6464
}

app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,59 +34,59 @@ class ProcessCronQueueObserver implements ObserverInterface
3434
/**#@+
3535
* Cache key values
3636
*/
37-
const CACHE_KEY_LAST_SCHEDULE_GENERATE_AT = 'cron_last_schedule_generate_at';
37+
public const CACHE_KEY_LAST_SCHEDULE_GENERATE_AT = 'cron_last_schedule_generate_at';
3838

39-
const CACHE_KEY_LAST_HISTORY_CLEANUP_AT = 'cron_last_history_cleanup_at';
39+
public const CACHE_KEY_LAST_HISTORY_CLEANUP_AT = 'cron_last_history_cleanup_at';
4040

4141
/**
4242
* Flag for internal communication between processes for running
4343
* all jobs in a group in parallel as a separate process
4444
*/
45-
const STANDALONE_PROCESS_STARTED = 'standaloneProcessStarted';
45+
public const STANDALONE_PROCESS_STARTED = 'standaloneProcessStarted';
4646

4747
/**#@-*/
4848

4949
/**#@+
5050
* List of configurable constants used to calculate and validate during handling cron jobs
5151
*/
52-
const XML_PATH_SCHEDULE_GENERATE_EVERY = 'schedule_generate_every';
52+
public const XML_PATH_SCHEDULE_GENERATE_EVERY = 'schedule_generate_every';
5353

54-
const XML_PATH_SCHEDULE_AHEAD_FOR = 'schedule_ahead_for';
54+
public const XML_PATH_SCHEDULE_AHEAD_FOR = 'schedule_ahead_for';
5555

56-
const XML_PATH_SCHEDULE_LIFETIME = 'schedule_lifetime';
56+
public const XML_PATH_SCHEDULE_LIFETIME = 'schedule_lifetime';
5757

58-
const XML_PATH_HISTORY_CLEANUP_EVERY = 'history_cleanup_every';
58+
public const XML_PATH_HISTORY_CLEANUP_EVERY = 'history_cleanup_every';
5959

60-
const XML_PATH_HISTORY_SUCCESS = 'history_success_lifetime';
60+
public const XML_PATH_HISTORY_SUCCESS = 'history_success_lifetime';
6161

62-
const XML_PATH_HISTORY_FAILURE = 'history_failure_lifetime';
62+
public const XML_PATH_HISTORY_FAILURE = 'history_failure_lifetime';
6363

6464
/**#@-*/
6565

6666
/**
6767
* Value of seconds in one minute
6868
*/
69-
const SECONDS_IN_MINUTE = 60;
69+
public const SECONDS_IN_MINUTE = 60;
7070

7171
/**
7272
* How long to wait for cron group to become unlocked
7373
*/
74-
const LOCK_TIMEOUT = 60;
74+
public const LOCK_TIMEOUT = 60;
7575

7676
/**
7777
* Static lock prefix for cron group locking
7878
*/
79-
const LOCK_PREFIX = 'CRON_';
79+
public const LOCK_PREFIX = 'CRON_';
8080

8181
/**
8282
* Timer ID for profiling
8383
*/
84-
const CRON_TIMERID = 'job %s';
84+
public const CRON_TIMERID = 'job %s';
8585

8686
/**
8787
* Max retries for acquire locks for cron jobs
8888
*/
89-
const MAX_RETRIES = 5;
89+
public const MAX_RETRIES = 5;
9090

9191
/**
9292
* @var ScheduleCollection
@@ -378,7 +378,7 @@ function () use ($schedule) {
378378
);
379379
if (!$e instanceof \Exception) {
380380
$e = new \RuntimeException(
381-
'Error when running a cron job',
381+
'Error when running a cron job: ' . $e->getMessage(),
382382
0,
383383
$e
384384
);

app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ function ($callback) {
619619
*/
620620
public function dispatchExceptionInCallbackDataProvider(): array
621621
{
622-
$throwable = new TypeError();
622+
$throwable = new TypeError('Description of TypeError');
623623
return [
624624
'non-callable callback' => [
625625
'Not_Existed_Class',
@@ -642,11 +642,11 @@ public function dispatchExceptionInCallbackDataProvider(): array
642642
new CronJobException(
643643
$throwable
644644
),
645-
'Error when running a cron job',
645+
'Error when running a cron job: Description of TypeError',
646646
2,
647647
1,
648648
new \RuntimeException(
649-
'Error when running a cron job',
649+
'Error when running a cron job: Description of TypeError',
650650
0,
651651
$throwable
652652
)

app/code/Magento/Customer/Observer/UpgradeOrderCustomerEmailObserver.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public function execute(Observer $observer): void
6666
}
6767
$searchCriteria = $this->searchCriteriaBuilder
6868
->addFilter(OrderInterface::CUSTOMER_ID, $customer->getId())
69+
->addFilter(OrderInterface::CUSTOMER_EMAIL, $originalCustomer->getEmail())
6970
->create();
7071

7172
/**

app/code/Magento/Customer/Test/Unit/Observer/UpgradeOrderCustomerEmailObserverTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ private function setOriginalCustomerToEventMock(MockObject $originalCustomer): v
171171

172172
private function setCustomerEmail(MockObject $originalCustomer, string $email): void
173173
{
174-
$originalCustomer->expects($this->once())
174+
$originalCustomer->expects($this->atLeastOnce())
175175
->method('getEmail')
176176
->willReturn($email);
177177
}
@@ -186,7 +186,7 @@ private function whenOrderRepositoryGetListIsCalled(MockObject $orderCollectionM
186186
->method('create')
187187
->willReturn($searchCriteriaMock);
188188

189-
$this->searchCriteriaBuilderMock->expects($this->once())
189+
$this->searchCriteriaBuilderMock->expects($this->atLeastOnce())
190190
->method('addFilter')
191191
->willReturn($this->searchCriteriaBuilderMock);
192192

app/code/Magento/Customer/view/frontend/web/template/show-password.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
*/
66
-->
77

8-
<input type="checkbox" name="show-password" title="Show Password" id="show-password" class="checkbox" data-role="show-password" ko-checked="isPasswordVisible">
8+
<input type="checkbox" name="show-password" data-bind="attr: {title : $t('Show Password')}" id="show-password" class="checkbox" data-role="show-password" ko-checked="isPasswordVisible">
99
<label for="show-password" class="label"><span translate="'Show Password'"></span></label>

app/code/Magento/GraphQl/README.md

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,38 @@
1-
# GraphQl
1+
# Magento_GraphQl module
22

3-
**GraphQl** provides the framework for the application to expose GraphQL compliant web services. It exposes an area for
3+
This module provides the framework for the application to expose GraphQL compliant web services. It exposes an area for
44
GraphQL services and resolves request data based on the generated schema. It also maps this response to a JSON object
55
for the client to read.
6+
7+
## Installation
8+
9+
The Magento_GraphQl module is one of the base Magento 2 modules. You cannot disable or uninstall this module.
10+
11+
This module is dependent on the following modules:
12+
- `Magento_Authorization`
13+
- `Magento_Eav`
14+
15+
The following modules depend on this module:
16+
- `Magento_BundleGraphQl`
17+
- `Magento_CatalogGraphQl`
18+
- `Magento_CmsGraphQl`
19+
- `Magento_CompareListGraphQl`
20+
- `Magento_ConfigurableProductGraphQl`
21+
- `Magento_DownloadableGraphQl`
22+
- `Magento_EavGraphQl`
23+
- `Magento_GraphQlCache`
24+
- `Magento_GroupedProductGraphQl`
25+
- `Magento_ReviewGraphQl`
26+
- `Magento_StoreGraphQl`
27+
28+
For information about a module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.4/install-gde/install/cli/install-cli-subcommands-enable.html).
29+
30+
## Extensibility
31+
32+
Extension developers can interact with the Magento_GraphQl module. For more information about the Magento extension mechanism, see [Magento plugins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html).
33+
34+
[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_GraphQl module.
35+
36+
## Additional information
37+
38+
You can get more information about [GraphQl In Magento 2](https://devdocs.magento.com/guides/v2.4/graphql).

0 commit comments

Comments
 (0)