Skip to content

Commit 2f31add

Browse files
author
Kostiantyn Poida
committed
Merge remote-tracking branch 'remotes/main/develop' into develop
2 parents c812a4e + 6e6e2af commit 2f31add

File tree

88 files changed

+544
-294
lines changed

Some content is hidden

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

88 files changed

+544
-294
lines changed

app/code/Magento/Authorization/sql/authorization_setup/install-2.0.0.php

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,7 @@
99

1010
$installer->startSetup();
1111

12-
if ($installer->getConnection()->isTableExists($installer->getTable('admin_role'))) {
13-
/**
14-
* Rename existing 'admin_role' table into 'authorization_role' (to avoid forcing Magento re-installation)
15-
* TODO: This conditional logic can be removed some time after pull request is delivered to the mainline
16-
*/
17-
$installer->getConnection()->renameTable(
18-
$installer->getTable('admin_role'),
19-
$installer->getTable('authorization_role')
20-
);
21-
} elseif (!$installer->getConnection()->isTableExists($installer->getTable('authorization_role'))) {
12+
if (!$installer->getConnection()->isTableExists($installer->getTable('authorization_role'))) {
2213
/**
2314
* Create table 'authorization_role'
2415
*/
@@ -84,16 +75,7 @@
8475
$installer->getConnection()->createTable($table);
8576
}
8677

87-
if ($installer->getConnection()->isTableExists($installer->getTable('admin_rule'))) {
88-
/**
89-
* Rename existing 'admin_rule' table into 'authorization_rule' (to avoid forcing Magento re-installation)
90-
* TODO: This conditional logic can be removed some time after pull request is delivered to the mainline
91-
*/
92-
$installer->getConnection()->renameTable(
93-
$installer->getTable('admin_rule'),
94-
$installer->getTable('authorization_rule')
95-
);
96-
} elseif (!$installer->getConnection()->isTableExists($installer->getTable('authorization_rule'))) {
78+
if (!$installer->getConnection()->isTableExists($installer->getTable('authorization_rule'))) {
9779
/**
9880
* Create table 'authorization_rule'
9981
*/

app/code/Magento/Backend/Controller/Adminhtml/System/Account/Save.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,9 @@ public function execute()
5454

5555
if ($this->_objectManager->get('Magento\Framework\Locale\Validator')->isValid($interfaceLocale)) {
5656
$user->setInterfaceLocale($interfaceLocale);
57-
$this->_objectManager->get(
58-
'Magento\Backend\Model\Locale\Manager'
59-
)->switchBackendInterfaceLocale(
60-
$interfaceLocale
61-
);
57+
/** @var \Magento\Backend\Model\Locale\Manager $localeManager */
58+
$localeManager = $this->_objectManager->get('Magento\Backend\Model\Locale\Manager');
59+
$localeManager->switchBackendInterfaceLocale($interfaceLocale);
6260
}
6361
/** Before updating admin user data, ensure that password of current admin user is entered and is correct */
6462
$currentUserPasswordField = \Magento\User\Block\User\Edit\Tab\Main::CURRENT_USER_PASSWORD_FIELD;
@@ -75,7 +73,10 @@ public function execute()
7573
$user->setPasswordConfirmation($passwordConfirmation);
7674
}
7775
$user->save();
78-
$user->sendPasswordResetNotificationEmail();
76+
/** Send password reset email notification only when password was changed */
77+
if ($password !== '') {
78+
$user->sendPasswordResetNotificationEmail();
79+
}
7980
$this->messageManager->addSuccess(__('The account has been saved.'));
8081
} catch (\Magento\Framework\Model\Exception $e) {
8182
$this->messageManager->addMessages($e->getMessages());

app/code/Magento/Backend/Controller/Adminhtml/System/Config/Save.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,10 @@ public function execute()
186186
$resultRedirect = $this->resultRedirectFactory->create();
187187
return $resultRedirect->setPath(
188188
'adminhtml/system_config/edit',
189-
['_current' => ['section', 'website', 'store']]
189+
[
190+
'_current' => ['section', 'website', 'store'],
191+
'_nosid' => true
192+
]
190193
);
191194
}
192195
}

app/code/Magento/Catalog/Model/Product/Media/AttributeManagement.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
*/
66
namespace Magento\Catalog\Model\Product\Media;
77

8-
use \Magento\Catalog\Api\ProductMediaAttributeManagementInterface;
9-
use \Magento\Store\Model\StoreManagerInterface;
10-
use \Magento\Catalog\Model\Product;
8+
use Magento\Catalog\Api\ProductMediaAttributeManagementInterface;
9+
use Magento\Store\Model\StoreManagerInterface;
10+
use Magento\Catalog\Model\Product;
1111

1212
class AttributeManagement implements ProductMediaAttributeManagementInterface
1313
{

app/code/Magento/Catalog/etc/webapi.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<resource ref="Magento_Catalog::products" />
2828
</resources>
2929
</route>
30-
<route url="/V1/products" method="PUT">
30+
<route url="/V1/products" method="GET">
3131
<service class="Magento\Catalog\Api\ProductRepositoryInterface" method="getList"/>
3232
<resources>
3333
<resource ref="Magento_Catalog::products" />
@@ -52,7 +52,7 @@
5252
<resource ref="Magento_Catalog::attributes_attributes" />
5353
</resources>
5454
</route>
55-
<route url="/V1/products/attributes" method="PUT">
55+
<route url="/V1/products/attributes" method="GET">
5656
<service class="Magento\Catalog\Api\ProductAttributeRepositoryInterface" method="getList" />
5757
<resources>
5858
<resource ref="Magento_Catalog::attributes_attributes" />
@@ -64,7 +64,7 @@
6464
<resource ref="Magento_Catalog::attributes_attributes" />
6565
</resources>
6666
</route>
67-
<route url="/V1/categories/attributes" method="PUT">
67+
<route url="/V1/categories/attributes" method="GET">
6868
<service class="Magento\Catalog\Api\CategoryAttributeRepositoryInterface" method="getList" />
6969
<resources>
7070
<resource ref="Magento_Catalog::attributes_attributes" />
@@ -100,7 +100,7 @@
100100
<resource ref="Magento_Catalog::products"/>
101101
</resources>
102102
</route>
103-
<route url="/V1/products/attribute-sets/sets/list" method="PUT">
103+
<route url="/V1/products/attribute-sets/sets/list" method="GET">
104104
<service class="Magento\Catalog\Api\AttributeSetRepositoryInterface" method="getList"/>
105105
<resources>
106106
<resource ref="Magento_Catalog::sets"/>
@@ -148,7 +148,7 @@
148148
<resource ref="Magento_Catalog::sets"/>
149149
</resources>
150150
</route>
151-
<route url="/V1/products/attribute-sets/groups/list" method="PUT">
151+
<route url="/V1/products/attribute-sets/groups/list" method="GET">
152152
<service class="Magento\Catalog\Api\ProductAttributeGroupRepositoryInterface" method="getList"/>
153153
<resources>
154154
<resource ref="Magento_Catalog::sets"/>

app/code/Magento/Catalog/view/frontend/templates/product/list/toolbar.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
* @var $this \Magento\Catalog\Block\Product\ProductList\Toolbar
1212
*/
13-
use \Magento\Catalog\Model\Product\ProductList\Toolbar;
13+
use Magento\Catalog\Model\Product\ProductList\Toolbar;
1414
?>
1515
<?php if ($this->getCollection()->getSize()): ?>
1616
<div class="toolbar toolbar-products" data-mage-init='<?php echo $this->getWidgetOptionsJson(); ?>'>

app/code/Magento/Catalog/view/frontend/templates/product/list/toolbar/amount.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
* @var $this \Magento\Catalog\Block\Product\ProductList\Toolbar
1212
*/
13-
use \Magento\Catalog\Model\Product\ProductList\Toolbar;
13+
use Magento\Catalog\Model\Product\ProductList\Toolbar;
1414
?>
1515
<p class="toolbar-amount">
1616
<?php if ($this->getLastPageNum() > 1): ?>

app/code/Magento/Catalog/view/frontend/templates/product/list/toolbar/limiter.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
* @var $this \Magento\Catalog\Block\Product\ProductList\Toolbar
1212
*/
13-
use \Magento\Catalog\Model\Product\ProductList\Toolbar;
13+
use Magento\Catalog\Model\Product\ProductList\Toolbar;
1414
?>
1515
<div class="field limiter">
1616
<label class="label" for="limiter">

app/code/Magento/Catalog/view/frontend/templates/product/list/toolbar/sorter.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
* @var $this \Magento\Catalog\Block\Product\ProductList\Toolbar
1212
*/
13-
use \Magento\Catalog\Model\Product\ProductList\Toolbar;
13+
use Magento\Catalog\Model\Product\ProductList\Toolbar;
1414
?>
1515
<div class="toolbar-sorter sorter">
1616
<label class="sorter-label" for="sorter"><?php echo __('Sort By') ?></label>

app/code/Magento/Catalog/view/frontend/templates/product/list/toolbar/viewmode.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
* @var $this \Magento\Catalog\Block\Product\ProductList\Toolbar
1212
*/
13-
use \Magento\Catalog\Model\Product\ProductList\Toolbar;
13+
use Magento\Catalog\Model\Product\ProductList\Toolbar;
1414
?>
1515
<?php if ($this->isEnabledViewSwitcher()): ?>
1616
<div class="modes">

app/code/Magento/CatalogUrlRewrite/Model/Category/Plugin/Category/Move.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
use Magento\Catalog\Model\Category;
99
use Magento\CatalogUrlRewrite\Model\CategoryUrlPathGenerator;
10-
use \Magento\CatalogUrlRewrite\Model\Category\ChildrenCategoriesProvider;
10+
use Magento\CatalogUrlRewrite\Model\Category\ChildrenCategoriesProvider;
1111

1212
class Move
1313
{

app/code/Magento/Checkout/Service/V1/PaymentMethod/ReadService.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
*/
66
namespace Magento\Checkout\Service\V1\PaymentMethod;
77

8-
use \Magento\Sales\Model\QuoteRepository;
9-
use \Magento\Store\Model\StoreManagerInterface;
8+
use Magento\Sales\Model\QuoteRepository;
109
use Magento\Checkout\Service\V1\Data\Cart\PaymentMethod\Converter as QuoteMethodConverter;
1110
use Magento\Checkout\Service\V1\Data\PaymentMethod\Converter as PaymentMethodConverter;
12-
use \Magento\Payment\Model\MethodList;
11+
use Magento\Payment\Model\MethodList;
1312

1413
/**
1514
* Payment method read service object.

app/code/Magento/Checkout/etc/webapi.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
<resource ref="Magento_Catalog::products" />
5656
</resources>
5757
</route>
58-
<route url="/V1/carts" method="PUT">
58+
<route url="/V1/carts" method="GET">
5959
<service class="Magento\Checkout\Service\V1\Cart\ReadServiceInterface" method="getCartList"/>
6060
<resources>
6161
<resource ref="Magento_Catalog::products" />

app/code/Magento/CheckoutAgreements/Service/V1/Agreement/ReadService.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
*/
66
namespace Magento\CheckoutAgreements\Service\V1\Agreement;
77

8-
use \Magento\CheckoutAgreements\Model\Resource\Agreement\CollectionFactory as AgreementCollectionFactory;
9-
use \Magento\CheckoutAgreements\Model\Resource\Agreement\Collection as AgreementCollection;
10-
use \Magento\CheckoutAgreements\Model\Agreement;
11-
use \Magento\Framework\App\Config\ScopeConfigInterface;
8+
use Magento\CheckoutAgreements\Model\Resource\Agreement\CollectionFactory as AgreementCollectionFactory;
9+
use Magento\CheckoutAgreements\Model\Resource\Agreement\Collection as AgreementCollection;
10+
use Magento\CheckoutAgreements\Model\Agreement;
11+
use Magento\Framework\App\Config\ScopeConfigInterface;
1212
use Magento\Store\Model\StoreManagerInterface;
13-
use \Magento\Store\Model\ScopeInterface;
14-
use \Magento\CheckoutAgreements\Service\V1\Data\AgreementBuilder;
15-
use \Magento\CheckoutAgreements\Service\V1\Data\Agreement as AgreementDataObject;
13+
use Magento\Store\Model\ScopeInterface;
14+
use Magento\CheckoutAgreements\Service\V1\Data\AgreementBuilder;
15+
use Magento\CheckoutAgreements\Service\V1\Data\Agreement as AgreementDataObject;
1616

1717
/**
1818
* Checkout agreement service.

app/code/Magento/ConfigurableProduct/Model/OptionRepository.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
*/
77
namespace Magento\ConfigurableProduct\Model;
88

9-
use \Magento\Framework\Exception\NoSuchEntityException;
10-
use \Magento\Webapi\Exception;
11-
use \Magento\Framework\Exception\StateException;
12-
use \Magento\Framework\Exception\InputException;
13-
use \Magento\Framework\Exception\CouldNotSaveException;
14-
use \Magento\ConfigurableProduct\Model\Product\Type\Configurable as ConfigurableType;
15-
use \Magento\Catalog\Model\Product\Type as ProductType;
16-
use \Magento\Store\Model\Store;
9+
use Magento\Framework\Exception\NoSuchEntityException;
10+
use Magento\Webapi\Exception;
11+
use Magento\Framework\Exception\StateException;
12+
use Magento\Framework\Exception\InputException;
13+
use Magento\Framework\Exception\CouldNotSaveException;
14+
use Magento\ConfigurableProduct\Model\Product\Type\Configurable as ConfigurableType;
15+
use Magento\Catalog\Model\Product\Type as ProductType;
16+
use Magento\Store\Model\Store;
1717

1818
/**
1919
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)

app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/super/config.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
/** @var $this \Magento\ConfigurableProduct\Block\Adminhtml\Product\Edit\Tab\Super\Config */
77

8-
use \Magento\ConfigurableProduct\Model\Product\Type\Configurable;
8+
use Magento\ConfigurableProduct\Model\Product\Type\Configurable;
99
?>
1010
<div class="entry-edit form-inline" id="<?php echo $this->getId() ?>">
1111
<div class="fieldset-wrapper collapsable-wrapper" id="<?php echo $this->getId() ?>-wrapper" data-panel="product-variations">

app/code/Magento/Customer/Model/GroupManagement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use Magento\Customer\Api\Data\GroupInterface;
1111
use Magento\Framework\Api\SearchCriteriaBuilder;
1212
use Magento\Framework\App\Config\ScopeConfigInterface;
13-
use \Magento\Framework\Api\FilterBuilder;
13+
use Magento\Framework\Api\FilterBuilder;
1414
use Magento\Framework\Exception\NoSuchEntityException;
1515
use Magento\Store\Model\StoreManagerInterface;
1616
use Magento\Customer\Api\GroupRepositoryInterface;

app/code/Magento/Customer/etc/webapi.xml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,6 @@
3232
<resource ref="Magento_Customer::group"/>
3333
</resources>
3434
</route>
35-
<route url="/V1/customerGroups/search" method="POST">
36-
<service class="Magento\Customer\Api\GroupRepositoryInterface" method="getList"/>
37-
<resources>
38-
<resource ref="Magento_Customer::group"/>
39-
</resources>
40-
</route>
4135
<route url="/V1/customerGroups/search" method="GET">
4236
<service class="Magento\Customer\Api\GroupRepositoryInterface" method="getList"/>
4337
<resources>
@@ -161,12 +155,6 @@
161155
<parameter name="customerId" force="true">%customer_id%</parameter>
162156
</data>
163157
</route>
164-
<route url="/V1/customers/search" method="POST">
165-
<service class="Magento\Customer\Api\CustomerRepositoryInterface" method="getList"/>
166-
<resources>
167-
<resource ref="Magento_Customer::customer"/>
168-
</resources>
169-
</route>
170158
<route url="/V1/customers/search" method="GET">
171159
<service class="Magento\Customer\Api\CustomerRepositoryInterface" method="getList"/>
172160
<resources>

app/code/Magento/Eav/etc/webapi.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="../../../../../app/code/Magento/Webapi/etc/webapi.xsd">
10-
<route url="/V1/eav/attribute-sets/list" method="PUT">
10+
<route url="/V1/eav/attribute-sets/list" method="GET">
1111
<service class="Magento\Eav\Api\AttributeSetRepositoryInterface" method="getList"/>
1212
<resources>
1313
<resource ref="Magento_Catalog::sets"/>

app/code/Magento/Integration/Controller/Adminhtml/Integration/Save.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ protected function _redirectOnSaveError()
3030
* Save integration action.
3131
*
3232
* @return void
33-
* @todo: Fix cyclomatic complexity.
3433
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
3534
*/
3635
public function execute()
@@ -56,7 +55,6 @@ public function execute()
5655
/** @var array $data */
5756
$data = $this->getRequest()->getPost();
5857
if (!empty($data)) {
59-
// TODO: Move out work with API permissions to Web API module
6058
if (!isset($data['resource'])) {
6159
$integrationData['resource'] = [];
6260
}

app/code/Magento/Integration/Model/Oauth/Token/Provider.php

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,24 @@ class Provider implements TokenProviderInterface
2222
*/
2323
protected $_tokenFactory;
2424

25+
/**
26+
* @var \Psr\Log\LoggerInterface
27+
*/
28+
protected $logger;
29+
2530
/**
2631
* @param \Magento\Integration\Model\Oauth\Consumer\Factory $consumerFactory
2732
* @param \Magento\Integration\Model\Oauth\TokenFactory $tokenFactory
33+
* @param \Psr\Log\LoggerInterface $logger
2834
*/
2935
public function __construct(
3036
\Magento\Integration\Model\Oauth\Consumer\Factory $consumerFactory,
31-
\Magento\Integration\Model\Oauth\TokenFactory $tokenFactory
37+
\Magento\Integration\Model\Oauth\TokenFactory $tokenFactory,
38+
\Psr\Log\LoggerInterface $logger
3239
) {
3340
$this->_consumerFactory = $consumerFactory;
3441
$this->_tokenFactory = $tokenFactory;
42+
$this->logger = $logger;
3543
}
3644

3745
/**
@@ -94,14 +102,17 @@ public function validateRequestToken($requestToken, $consumer, $oauthVerifier)
94102
*/
95103
public function getAccessToken($consumer)
96104
{
97-
/** TODO: log the request token in dev mode since its not persisted. */
98-
$token = $this->getIntegrationTokenByConsumerId($consumer->getId());
105+
$consumerId = $consumer->getId();
106+
$token = $this->getIntegrationTokenByConsumerId($consumerId);
99107
if (Token::TYPE_REQUEST != $token->getType()) {
100108
throw new \Magento\Framework\Oauth\Exception(
101109
'Cannot get access token because consumer token is not a request token'
102110
);
103111
}
104112
$accessToken = $token->convertToAccess();
113+
$this->logger->info(
114+
'Request token ' . $token->getToken() . ' was exchanged to obtain access token for consumer ' . $consumerId
115+
);
105116
return ['oauth_token' => $accessToken->getToken(), 'oauth_token_secret' => $accessToken->getSecret()];
106117
}
107118

app/code/Magento/Integration/Service/V1/Integration.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ public function create(array $integrationData)
4545
{
4646
$this->_checkIntegrationByName($integrationData['name']);
4747
$integration = $this->_integrationFactory->create($integrationData);
48-
// TODO: Think about double save issue
4948
$integration->save();
5049
$consumerName = 'Integration' . $integration->getId();
5150
$consumer = $this->_oauthService->createConsumer(['name' => $consumerName]);

app/code/Magento/Integration/Service/V1/Oauth.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
/**
1717
* Integration oAuth service.
1818
*
19-
* TODO: Fix coupling between objects
2019
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2120
*/
2221
class Oauth implements OauthInterface

app/code/Magento/ProductAlert/Model/Email.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,11 @@ public function send()
299299
return false;
300300
}
301301

302-
$store = $this->_website->getDefaultStore();
302+
if ($this->_customer->getStoreId() > 0) {
303+
$store = $this->_storeManager->getStore($this->_customer->getStoreId());
304+
} else {
305+
$store = $this->_website->getDefaultStore();
306+
}
303307
$storeId = $store->getId();
304308

305309
if ($this->_type == 'price' && !$this->_scopeConfig->getValue(

0 commit comments

Comments
 (0)