Skip to content

Commit a6791be

Browse files
committed
Merge branch '2.3-develop' of https://github.com/magento/magento2ce into MC-19432
2 parents 28792f6 + adee85d commit a6791be

File tree

22 files changed

+743
-8909
lines changed

22 files changed

+743
-8909
lines changed
Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,38 @@
1-
AdvancedSearch module introduces advanced search functionality and provides interfaces that allow to implement this functionality by 3rd party search engines
1+
# Magento_AdvancedSearch module
2+
The Magento_AdvancedSearch module introduces advanced search functionality and provides interfaces that allow third-party search engines to implement this functionality.
3+
4+
## Installation details
5+
6+
Before disabling or uninstalling this module, note that the following modules depends on this module:
7+
- Magento_Elasticsearch
8+
- Magento_Elasticsearch6
9+
10+
For information about module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.3/install-gde/install/cli/install-cli-subcommands-enable.html).
11+
12+
## Extensibility
13+
14+
Extension developers can interact with the Magento_AdvancedSearch module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html).
15+
16+
[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_AdvancedSearch module.
17+
18+
### Events
19+
20+
This module observes the following event:
21+
22+
- `catalogsearch_query_save_after` in the `Magento\AdvancedSearch\Model\Recommendations\SaveSearchQueryRelationsObserver` file.
23+
24+
For information about an event in Magento 2, see [Events and observers](http://devdocs.magento.com/guides/v2.3/extension-dev-guide/events-and-observers.html#events).
25+
26+
### Layouts
27+
28+
The module interacts with the following layout handles in the `view/adminhtml/layout` directory:
29+
30+
- `catalog_search_block`
31+
- `catalog_search_edit`
32+
- `catalog_search_relatedgrid`
33+
34+
The module interacts with the following layout handles in the `view/frontend/layout` directory:
35+
36+
- `catalogsearch_result_index`
37+
38+
For more information about layouts in Magento 2, see the [Layout documentation](https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/layouts/layout-overview.html).
Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
1-
# Authorization
1+
# Magento_Authorization module
22

3-
**Authorization** enables management of access control list roles and
4-
rules in the application.
3+
The Magento_Authorization module enables management of access control list roles and rules in the application.
4+
5+
## Installation details
6+
7+
The Magento_AdminNotification module creates the following tables in the database:
8+
9+
- `authorization_role`
10+
- `authorization_rule`
11+
12+
Before disabling or uninstalling this module, note that the Magento_GraphQl module depends on this module.
13+
14+
For information about module installation in Magento 2, see [Enable or disable modules](https://devdocs.magento.com/guides/v2.3/install-gde/install/cli/install-cli-subcommands-enable.html).
15+
16+
## Extensibility
17+
18+
Extension developers can interact with the Magento_Authorization module. For more information about the Magento extension mechanism, see [Magento plug-ins](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/plugins.html).
19+
20+
[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Authorization module.

app/code/Magento/Backend/etc/adminhtml/system.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@
145145
<field id="allow_symlink" translate="label comment" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
146146
<label>Allow Symlinks</label>
147147
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
148-
<comment>Warning! Enabling this feature is not recommended on production environments because it represents a potential security risk.</comment>
148+
<comment>
149+
<![CDATA[<strong style="color:red">Warning!</strong> Enabling this feature is not recommended on production environments because it represents a potential security risk.]]>
150+
</comment>
149151
</field>
150152
<field id="minify_html" translate="label comment" type="select" sortOrder="25" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
151153
<label>Minify Html</label>
@@ -435,7 +437,7 @@
435437
<label>Admin Session Lifetime (seconds)</label>
436438
<comment>Please enter at least 60 and at most 31536000 (one year).</comment>
437439
<backend_model>Magento\Backend\Model\Config\SessionLifetime\BackendModel</backend_model>
438-
<validate>validate-digits</validate>
440+
<validate>validate-digits validate-digits-range digits-range-60-31536000</validate>
439441
</field>
440442
</group>
441443
<group id="dashboard" translate="label" sortOrder="40" showInDefault="1" showInWebsite="0" showInStore="0">

app/code/Magento/Backend/i18n/en_US.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ Debug,Debug
333333
"Add Block Names to Hints","Add Block Names to Hints"
334334
"Template Settings","Template Settings"
335335
"Allow Symlinks","Allow Symlinks"
336-
"Warning! Enabling this feature is not recommended on production environments because it represents a potential security risk.","Warning! Enabling this feature is not recommended on production environments because it represents a potential security risk."
336+
"<strong style=""color:red"">Warning!</strong> Enabling this feature is not recommended on production environments because it represents a potential security risk.","<strong style=""color:red"">Warning!</strong> Enabling this feature is not recommended on production environments because it represents a potential security risk."
337337
"Minify Html","Minify Html"
338338
"Minification is not applied in developer mode.","Minification is not applied in developer mode."
339339
"Translate Inline","Translate Inline"

app/code/Magento/Backend/view/adminhtml/templates/admin/access_denied.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
<li>
2222
<span><?= $block->escapeHtml(__('Return to ')) ?>
2323
<?php if (isset($_SERVER['HTTP_REFERER'])) : ?>
24-
<a href="<?= $block->escapeUrl(__($_SERVER['HTTP_REFERER'])) ?>">
24+
<a href="<?= $block->escapeUrl($_SERVER['HTTP_REFERER']) ?>">
2525
<?= $block->escapeHtml(__('previous page')) ?></a><?= $block->escapeHtml(__('.')) ?>
2626
<?php else : ?>
27-
<a href="<?= $block->escapeHtmlAttr(__('javascript:history.back()')) ?>">
27+
<a href="<?= $block->escapeHtmlAttr('javascript:history.back()') ?>">
2828
<?= $block->escapeHtml(__('previous page')) ?></a><?= $block->escapeHtml(__('.')) ?>
2929
<?php endif ?>
3030
</span>

app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Full.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ private function switchTables(): void
152152
*
153153
* @return $this
154154
*/
155-
public function execute(): self
155+
public function execute(): Full
156156
{
157157
$this->createTables();
158158
$this->clearReplicaTables();

app/code/Magento/Directory/etc/adminhtml/system.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
</field>
4444
<field id="timeout" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
4545
<label>Connection Timeout in Seconds</label>
46+
<validate>validate-zero-or-greater validate-number</validate>
4647
</field>
4748
</group>
4849
<group id="currencyconverterapi" translate="label" sortOrder="45" showInDefault="1" showInWebsite="0" showInStore="0">
@@ -54,6 +55,7 @@
5455
</field>
5556
<field id="timeout" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
5657
<label>Connection Timeout in Seconds</label>
58+
<validate>validate-zero-or-greater validate-number</validate>
5759
</field>
5860
</group>
5961
<group id="import" translate="label" type="text" sortOrder="50" showInDefault="1" showInWebsite="0" showInStore="0">
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
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\Sales\Model\Order;
9+
10+
use Magento\Customer\Api\Data\CustomerInterface;
11+
use Magento\Framework\Event\ManagerInterface;
12+
use Magento\Sales\Api\Data\OrderInterface;
13+
use Magento\Sales\Api\OrderRepositoryInterface;
14+
15+
/**
16+
* Assign customer to order.
17+
*/
18+
class CustomerAssignment
19+
{
20+
/**
21+
* @var ManagerInterface
22+
*/
23+
private $eventManager;
24+
25+
/**
26+
* @var OrderRepositoryInterface
27+
*/
28+
private $orderRepository;
29+
30+
/**
31+
* CustomerAssignment constructor.
32+
*
33+
* @param ManagerInterface $eventManager
34+
* @param OrderRepositoryInterface $orderRepository
35+
*/
36+
public function __construct(
37+
ManagerInterface $eventManager,
38+
OrderRepositoryInterface $orderRepository
39+
) {
40+
$this->eventManager = $eventManager;
41+
$this->orderRepository = $orderRepository;
42+
}
43+
44+
/**
45+
* Assign customer to order.
46+
*
47+
* @param OrderInterface $order
48+
* @param CustomerInterface $customer
49+
*/
50+
public function execute(OrderInterface $order, CustomerInterface $customer): void
51+
{
52+
$order->setCustomerId($customer->getId())
53+
->setCustomerIsGuest(false)
54+
->setCustomerEmail($customer->getEmail())
55+
->setCustomerFirstname($customer->getFirstname())
56+
->setCustomerLastname($customer->getLastname())
57+
->setCustomerMiddlename($customer->getMiddlename())
58+
->setCustomerPrefix($customer->getPrefix())
59+
->setCustomerSuffix($customer->getSuffix())
60+
->setCustomerGroupId($customer->getGroupId());
61+
62+
$this->orderRepository->save($order);
63+
64+
$this->eventManager->dispatch(
65+
'sales_order_customer_assign_after',
66+
[
67+
'order' => $order,
68+
'customer' => $customer
69+
]
70+
);
71+
}
72+
}

app/code/Magento/Sales/Observer/AssignOrderToCustomerObserver.php

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Magento\Framework\Event\Observer;
1212
use Magento\Framework\Event\ObserverInterface;
1313
use Magento\Sales\Api\OrderRepositoryInterface;
14+
use Magento\Sales\Model\Order\CustomerAssignment;
1415

1516
/**
1617
* Assign order to customer created after issuing guest order.
@@ -23,11 +24,22 @@ class AssignOrderToCustomerObserver implements ObserverInterface
2324
private $orderRepository;
2425

2526
/**
27+
* @var CustomerAssignment
28+
*/
29+
private $assignmentService;
30+
31+
/**
32+
* AssignOrderToCustomerObserver constructor.
33+
*
2634
* @param OrderRepositoryInterface $orderRepository
35+
* @param CustomerAssignment $assignmentService
2736
*/
28-
public function __construct(OrderRepositoryInterface $orderRepository)
29-
{
37+
public function __construct(
38+
OrderRepositoryInterface $orderRepository,
39+
CustomerAssignment $assignmentService
40+
) {
3041
$this->orderRepository = $orderRepository;
42+
$this->assignmentService = $assignmentService;
3143
}
3244

3345
/**
@@ -43,18 +55,8 @@ public function execute(Observer $observer)
4355
if (array_key_exists('__sales_assign_order_id', $delegateData)) {
4456
$orderId = $delegateData['__sales_assign_order_id'];
4557
$order = $this->orderRepository->get($orderId);
46-
if (!$order->getCustomerId()) {
47-
//assign customer info to order after customer creation.
48-
$order->setCustomerId($customer->getId())
49-
->setCustomerIsGuest(0)
50-
->setCustomerEmail($customer->getEmail())
51-
->setCustomerFirstname($customer->getFirstname())
52-
->setCustomerLastname($customer->getLastname())
53-
->setCustomerMiddlename($customer->getMiddlename())
54-
->setCustomerPrefix($customer->getPrefix())
55-
->setCustomerSuffix($customer->getSuffix())
56-
->setCustomerGroupId($customer->getGroupId());
57-
$this->orderRepository->save($order);
58+
if (!$order->getCustomerId() && $customer->getId()) {
59+
$this->assignmentService->execute($order, $customer);
5860
}
5961
}
6062
}

0 commit comments

Comments
 (0)