Skip to content

Commit 0ec521e

Browse files
AnujNehraAnujNehra
authored andcommitted
ACP2E-1776: Creating customer(-s) via Async REST API ignores group_id
1 parent c6ad842 commit 0ec521e

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

app/code/Magento/Customer/Plugin/AsyncRequestCustomerGroupAuthorization.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,12 @@ class AsyncRequestCustomerGroupAuthorization
3333

3434
/**
3535
*
36-
* @param AuthorizationInterface|null $authorization
36+
* @param AuthorizationInterface $authorization
3737
*/
3838
public function __construct(
39-
AuthorizationInterface $authorization = null
39+
AuthorizationInterface $authorization
4040
) {
41-
$objectManager = ObjectManager::getInstance();
42-
$this->authorization = $authorization ?? $objectManager->get(AuthorizationInterface::class);
41+
$this->authorization = $authorization;
4342
}
4443

4544
/**
@@ -50,7 +49,7 @@ public function __construct(
5049
* @param array $entitiesArray
5150
* @param string|null $groupId
5251
* @param string|null $userId
53-
* @return void
52+
* @return null
5453
* @throws AuthorizationException
5554
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
5655
*/
@@ -60,7 +59,7 @@ public function beforePublishMass(
6059
array $entitiesArray,
6160
string $groupId = null,
6261
string $userId = null
63-
): void {
62+
) {
6463
foreach ($entitiesArray as $entityParams) {
6564
foreach ($entityParams as $entity) {
6665
if ($entity instanceof CustomerInterface) {
@@ -74,5 +73,6 @@ public function beforePublishMass(
7473
}
7574
}
7675
}
76+
return null;
7777
}
7878
}

app/code/Magento/Customer/Test/Plugin/AsyncRequestCustomerGroupAuthorizationTest.php renamed to app/code/Magento/Customer/Test/Unit/Plugin/AsyncRequestCustomerGroupAuthorizationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
declare(strict_types=1);
77

8-
namespace Magento\Customer\Test\Plugin;
8+
namespace Magento\Customer\Test\Unit\Plugin;
99

1010
use Magento\AsynchronousOperations\Model\MassSchedule;
1111
use Magento\Customer\Api\CustomerRepositoryInterface;

0 commit comments

Comments
 (0)