Skip to content

Commit 8d897fa

Browse files
merge magento/2.3-develop into magento-epam/EPAM-PR-74
2 parents 0df098a + 5860041 commit 8d897fa

File tree

95 files changed

+3942
-672
lines changed

Some content is hidden

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

95 files changed

+3942
-672
lines changed

app/code/Magento/Analytics/README.md

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
1-
# Magento_Analytics Module
1+
# Magento_Analytics module
22

33
The Magento_Analytics module integrates your Magento instance with the [Magento Business Intelligence (MBI)](https://magento.com/products/business-intelligence) to use [Advanced Reporting](https://devdocs.magento.com/guides/v2.3/advanced-reporting/modules.html) functionality.
44

55
The module implements the following functionality:
66

7-
* enabling subscription to the MBI and automatic re-subscription
8-
* changing the base URL with the same MBI account remained
9-
* declaring the configuration schemas for report data collection
10-
* collecting the Magento instance data as reports for the MBI
11-
* introducing API that provides the collected data
12-
* extending Magento configuration with the module parameters:
13-
* subscription status (enabled/disabled)
14-
* industry (a business area in which the instance website works)
15-
* time of data collection (time of the day when the module collects data)
7+
- Enabling subscription to Magento Business Intelligence (MBI) and automatic re-subscription
8+
- Declaring the configuration schemas for report data collection
9+
- Collecting the Magento instance data as reports for MBI
10+
- Introducing API that provides the collected data
11+
- Extending Magento configuration with the module parameters:
12+
- Subscription status (enabled/disabled)
13+
- Industry (a business area in which the instance website works)
14+
- Time of data collection (time of the day when the module collects data)
15+
16+
## Installation details
17+
18+
Before disabling or uninstalling this module, note that the following modules depends on this module:
19+
- Magento_CatalogAnalytics
20+
- Magento_CustomerAnalytics
21+
- Magento_QuoteAnalytics
22+
- Magento_ReviewAnalytics
23+
- Magento_SalesAnalytics
24+
- Magento_WishlistAnalytics
1625

1726
## Structure
1827

@@ -29,12 +38,12 @@ The subscription to the MBI service is enabled during the installation process o
2938
Configuration settings for the Analytics module can be modified in the Admin Panel on the Stores > Configuration page under the General > Advanced Reporting tab.
3039

3140
The following options can be adjusted:
32-
* Advanced Reporting Service (Enabled/Disabled)
33-
* Alters the status of the Advanced Reporting subscription
34-
* Time of day to send data (Hour/Minute/Second in the store's time zone)
35-
* Defines when the data collection process for the Advanced Reporting service occurs
36-
* Industry
37-
* Defines the industry of the store in order to create a personalized Advanced Reporting experience
41+
- Advanced Reporting Service (Enabled/Disabled)
42+
- Alters the status of the Advanced Reporting subscription
43+
- Time of day to send data (Hour/Minute/Second in the store's time zone)
44+
- Defines when the data collection process for the Advanced Reporting service occurs
45+
- Industry
46+
- Defines the industry of the store in order to create a personalized Advanced Reporting experience
3847

3948
## Extensibility
4049

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<label>Bulk Actions</label>
1414
<field id="lifetime" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
1515
<label>Days Saved in Log</label>
16+
<validate>validate-zero-or-greater validate-digits</validate>
1617
</field>
1718
</group>
1819
</section>

app/code/Magento/Backend/README.md

Lines changed: 112 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,112 @@
1-
The Backend module contains common infrastructure and assets for other modules to be defined and used in their
2-
administration user interface (UI). It does not contain anything specific to other modules. Among many things it
3-
handles the logic of authenticating and authorizing users.
1+
# Magento_Backend module
2+
3+
The Magento_Backend module contains common infrastructure and assets for other modules to be defined and used in their
4+
administration user interface (UI).
5+
6+
The Magento_Backend module does not contain anything specific to other modules. Among many things it handles the logic of authenticating and authorizing users.
7+
8+
## Installation details
9+
10+
Before disabling or uninstalling this module, note that the following modules depends on this module:
11+
12+
- Magento_Analytics
13+
- Magento_Authorization
14+
- Magento_NewRelicReporting
15+
- Magento_ProductVideo
16+
- Magento_ReleaseNotification
17+
- Magento_Search
18+
- Magento_Security
19+
- Magento_Signifyd
20+
- Magento_Swatches
21+
- Magento_Ui
22+
- Magento_User
23+
- Magento_Webapi
24+
25+
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).
26+
27+
## Structure
28+
29+
Beyond the [usual module file structure](https://devdocs.magento.com/guides/v2.3/architecture/archi_perspectives/components/modules/mod_intro.html) the module contains a directory `Service/V1`.
30+
31+
`Service/V1` - contains logic to provide a list of modules installed in Magento.
32+
33+
For information about typical file structure of a module in Magento 2, see [Module file structure](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/build/module-file-structure.html#module-file-structure).
34+
35+
## Extensibility
36+
37+
Extension developers can interact with the Magento_Backend 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).
38+
39+
[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_Backend module.
40+
41+
### Events
42+
43+
The module dispatches the following events:
44+
45+
- `adminhtml_block_html_before` event in the `\Magento\Backend\Block\Template::_toHtml()` method. Parameters:
46+
- `block` is the backend block template (this) (`\Magento\Backend\Block\Template` class).
47+
- `adminhtml_store_edit_form_prepare_form` event in the `\Magento\Backend\Block\System\Store\Edit\AbstractForm::_prepareForm()` method. Parameters:
48+
- `block` is the AbstractForm block (this) (`\Magento\Backend\Block\System\Store\Edit\AbstractForm` class).
49+
- `backend_block_widget_grid_prepare_grid_before` event in the `\Magento\Backend\Block\Widget\Grid::_prepareGrid()` method. Parameters:
50+
- `grid` is the widget grid block (this) (`\Magento\Backend\Block\Widget\Grid` class)
51+
- `collection` is the grid collection (`\Magento\Framework\Data\Collection` class).
52+
- `adminhtml_cache_flush_system` event in the `\Magento\Backend\Console\Command\CacheCleanCommand::performAction()` method.
53+
- `adminhtml_cache_flush_all` event in the `\Magento\Backend\Console\Command\CacheFlushCommand::performAction()` method.
54+
- `clean_catalog_images_cache_after` event in the `\Magento\Backend\Controller\Adminhtml\Cache\CleanImages::execute()` method.
55+
- `clean_media_cache_after` event in the `\Magento\Backend\Controller\Adminhtml\Cache\CleanMedia::execute()` method.
56+
- `clean_static_files_cache_after` event in the `\Magento\Backend\Controller\Adminhtml\Cache\CleanStaticFiles::execute()` method.
57+
- `adminhtml_cache_flush_all` event in the `\Magento\Backend\Controller\Adminhtml\Cache\FlushAll::execute()` method.
58+
- `adminhtml_cache_flush_system` event in the `\Magento\Backend\Controller\Adminhtml\Cache\FlushSystem::execute()` method.
59+
- `theme_save_after` event in the `\Magento\Backend\Controller\Adminhtml\System\Design\Save::execute()` method.
60+
- `backend_auth_user_login_success` event in the `\Magento\Backend\Model\Auth::login()` method. Parameters:
61+
- `user` is the credential storage object (`null | \Magento\Backend\Model\Auth\Credential\StorageInterface`)
62+
- `backend_auth_user_login_failed` event in the `\Magento\Backend\Model\Auth::login()` method. Parameters:
63+
- `user_name` is username extracted from the credential storage object (`null | \Magento\Backend\Model\Auth\Credential\StorageInterface`)
64+
- `exception` any exception generated (`\Magento\Framework\Exception\LocalizedException | \Magento\Framework\Exception\Plugin\AuthenticationException`)
65+
66+
For information about an event in Magento 2, see [Events and observers](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/events-and-observers.html#events).
67+
68+
### Layouts
69+
70+
This module introduces the following layouts and layout handles in the `view/adminhtml/layout` directory:
71+
72+
- `admin_login`
73+
- `adminhtml_auth_login`
74+
- `adminhtml_cache_block`
75+
- `adminhtml_cache_index`
76+
- `adminhtml_dashboard_customersmost`
77+
- `adminhtml_dashboard_customersnewest`
78+
- `adminhtml_dashboard_index`
79+
- `adminhtml_dashboard_productsviewed`
80+
- `adminhtml_denied`
81+
- `adminhtml_noroute`
82+
- `adminhtml_system_account_index`
83+
- `adminhtml_system_design_edit`
84+
- `adminhtml_system_design_grid`
85+
- `adminhtml_system_design_grid_block`
86+
- `adminhtml_system_design_index`
87+
- `adminhtml_system_store_deletestore`
88+
- `adminhtml_system_store_editstore`
89+
- `adminhtml_system_store_grid_block`
90+
- `adminhtml_system_store_index`
91+
- `default`
92+
- `editor`
93+
- `empty`
94+
- `formkey`
95+
- `overlay_popup`
96+
- `popup`
97+
98+
99+
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).
100+
101+
### UI components
102+
103+
You can extend Magento_Backend module using the following configuration files:
104+
105+
- `view/adminhtml/ui_component/design_config_form.xml`
106+
- `view/adminhtml/ui_component/design_config_listing.xml`
107+
108+
For information about UI components in Magento 2, see [Overview of UI components](https://devdocs.magento.com/guides/v2.3/ui_comp_guide/bk-ui_comps.html).
109+
110+
## Additional information
111+
112+
For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html).

app/code/Magento/Backup/README.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1-
The Backup module allows administrators to perform backups and rollbacks. Types of backups include system, database and media backups. This module relies on the Cron module to schedule backups.
1+
# Magento_Backup module
22

3-
This module does not affect the storefront.
3+
The Magento_Backup module allows administrators to perform backups and rollbacks. Types of backups include system, database and media backups. This module relies on the Cron module to schedule backups.
4+
5+
The Magento_Backup module does not affect the storefront.
6+
7+
For more information about this module, see [Magento Backups](https://docs.magento.com/m2/ce/user_guide/system/backups.html)
8+
9+
## Extensibility
10+
11+
Extension developers can interact with the Magento_Backup 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).
12+
13+
[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_Backup module.
14+
15+
### Layouts
16+
17+
This module introduces the following layouts and layout handles in the `view/adminhtml/layout` directory:
18+
19+
`backup_index_block`
20+
`backup_index_disabled`
21+
`backup_index_grid`
22+
`backup_index_index`
23+
24+
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).
25+
26+
## Additional information
27+
28+
For information about significant changes in patch releases, see [2.3.x Release information](https://devdocs.magento.com/guides/v2.3/release-notes/bk-release-notes.html).

app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/paypal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ define([
336336
}
337337

338338
return {
339-
line1: address.street[0],
339+
line1: _.isUndefined(address.street) || _.isUndefined(address.street[0]) ? '' : address.street[0],
340340
city: address.city,
341341
state: address.regionCode,
342342
postalCode: address.postcode,

app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Button/Back.php

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,32 @@
1111
class Back extends Generic
1212
{
1313
/**
14+
* Get Button Data
15+
*
1416
* @return array
1517
*/
1618
public function getButtonData()
1719
{
1820
return [
1921
'label' => __('Back'),
20-
'on_click' => sprintf("location.href = '%s';", $this->getUrl('*/*/')),
22+
'on_click' => sprintf("location.href = '%s';", $this->getBackUrl()),
2123
'class' => 'back',
2224
'sort_order' => 10
2325
];
2426
}
27+
/**
28+
* Get URL for back
29+
*
30+
* @return string
31+
*/
32+
private function getBackUrl()
33+
{
34+
if ($this->context->getRequestParam('customerId')) {
35+
return $this->getUrl(
36+
'customer/index/edit',
37+
['id' => $this->context->getRequestParam('customerId')]
38+
);
39+
}
40+
return $this->getUrl('*/*/');
41+
}
2542
}

app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/StockDataFilter.php

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
use Magento\CatalogInventory\Api\StockConfigurationInterface;
99
use Magento\Framework\App\Config\ScopeConfigInterface;
10+
use Magento\CatalogInventory\Model\Stock;
1011

1112
/**
1213
* Class StockDataFilter
@@ -60,8 +61,8 @@ public function filter(array $stockData)
6061
$stockData['qty'] = self::MAX_QTY_VALUE;
6162
}
6263

63-
if (isset($stockData['min_qty']) && (int)$stockData['min_qty'] < 0) {
64-
$stockData['min_qty'] = 0;
64+
if (isset($stockData['min_qty'])) {
65+
$stockData['min_qty'] = $this->purifyMinQty($stockData['min_qty'], $stockData['backorders']);
6566
}
6667

6768
if (!isset($stockData['is_decimal_divided']) || $stockData['is_qty_decimal'] == 0) {
@@ -70,4 +71,27 @@ public function filter(array $stockData)
7071

7172
return $stockData;
7273
}
74+
75+
/**
76+
* Purifies min_qty.
77+
*
78+
* @param int $minQty
79+
* @param int $backOrders
80+
* @return float
81+
*/
82+
private function purifyMinQty(int $minQty, int $backOrders): float
83+
{
84+
/**
85+
* As described in the documentation if the Backorders Option is disabled
86+
* it is recommended to set the Out Of Stock Threshold to a positive number.
87+
* That's why to clarify the logic to the end user the code below prevent him to set a negative number so such
88+
* a number will turn to zero.
89+
* @see https://docs.magento.com/m2/ce/user_guide/catalog/inventory-backorders.html
90+
*/
91+
if ($backOrders === Stock::BACKORDERS_NO && $minQty < 0) {
92+
$minQty = 0;
93+
}
94+
95+
return (float)$minQty;
96+
}
7397
}

app/code/Magento/Catalog/Model/Layer/FilterList.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
67

78
namespace Magento\Catalog\Model\Layer;
89

10+
/**
11+
* Layer navigation filters
12+
*/
913
class FilterList
1014
{
1115
const CATEGORY_FILTER = 'category';
@@ -106,9 +110,9 @@ protected function getAttributeFilterClass(\Magento\Catalog\Model\ResourceModel\
106110
{
107111
$filterClassName = $this->filterTypes[self::ATTRIBUTE_FILTER];
108112

109-
if ($attribute->getAttributeCode() == 'price') {
113+
if ($attribute->getFrontendInput() === 'price') {
110114
$filterClassName = $this->filterTypes[self::PRICE_FILTER];
111-
} elseif ($attribute->getBackendType() == 'decimal') {
115+
} elseif ($attribute->getBackendType() === 'decimal') {
112116
$filterClassName = $this->filterTypes[self::DECIMAL_FILTER];
113117
}
114118

app/code/Magento/Catalog/Model/Product/Option/Type/Date.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ public function prepareForCart()
159159

160160
if ($this->_dateExists()) {
161161
if ($this->useCalendar()) {
162-
$timestamp += $this->_localeDate->date($value['date'], null, true, false)->getTimestamp();
162+
$timestamp += $this->_localeDate->date($value['date'], null, false, false)->getTimestamp();
163163
} else {
164164
$timestamp += mktime(0, 0, 0, $value['month'], $value['day'], $value['year']);
165165
}

app/code/Magento/Catalog/Plugin/Block/Topmenu.php

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Catalog\Plugin\Block;
79

810
use Magento\Catalog\Model\Category;
@@ -156,12 +158,13 @@ private function getCurrentCategory()
156158
*/
157159
private function getCategoryAsArray($category, $currentCategory, $isParentActive)
158160
{
161+
$categoryId = $category->getId();
159162
return [
160163
'name' => $category->getName(),
161-
'id' => 'category-node-' . $category->getId(),
164+
'id' => 'category-node-' . $categoryId,
162165
'url' => $this->catalogCategory->getCategoryUrl($category),
163-
'has_active' => in_array((string)$category->getId(), explode('/', $currentCategory->getPath()), true),
164-
'is_active' => $category->getId() == $currentCategory->getId(),
166+
'has_active' => in_array((string)$categoryId, explode('/', (string)$currentCategory->getPath()), true),
167+
'is_active' => $categoryId == $currentCategory->getId(),
165168
'is_category' => true,
166169
'is_parent_active' => $isParentActive
167170
];
@@ -193,4 +196,22 @@ protected function getCategoryTree($storeId, $rootId)
193196

194197
return $collection;
195198
}
199+
200+
/**
201+
* Add active
202+
*
203+
* @param \Magento\Theme\Block\Html\Topmenu $subject
204+
* @param string[] $result
205+
* @return string[]
206+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
207+
*/
208+
public function afterGetCacheKeyInfo(\Magento\Theme\Block\Html\Topmenu $subject, array $result)
209+
{
210+
$activeCategory = $this->getCurrentCategory();
211+
if ($activeCategory) {
212+
$result[] = Category::CACHE_TAG . '_' . $activeCategory->getId();
213+
}
214+
215+
return $result;
216+
}
196217
}

0 commit comments

Comments
 (0)