Skip to content

Commit 6070026

Browse files
committed
#36431: Undefined index in TierPriceValidator.php
- fixed issue with undefined index customer group for changing tier price
1 parent 6909196 commit 6070026

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

app/code/Magento/Catalog/Model/Product/Price/Validation/TierPriceValidator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,13 +475,15 @@ private function retrieveGroupValue(string $code)
475475
$item = array_shift($items);
476476

477477
if (!$item) {
478+
$this->customerGroupsByCode[$code] = false;
478479
return false;
479480
}
480481

481482
$itemCode = $item->getCode();
482483
$itemId = $item->getId();
483484

484485
if ($itemCode !== $code) {
486+
$this->customerGroupsByCode[$code] = false;
485487
return false;
486488
}
487489

app/code/Magento/Customer/Controller/Adminhtml/Group/Save.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ public function execute()
9191
? [] : $this->getRequest()->getParam('customer_group_excluded_websites');
9292
$resultRedirect = $this->resultRedirectFactory->create();
9393
try {
94-
$customerGroupCode = trim((string)$this->getRequest()->getParam('code'));
94+
$requestCode = $this->getRequest()->getParam('code');
95+
$customerGroupCode = is_string($requestCode) ? trim($requestCode) : $requestCode;
9596

9697
if ($id !== null) {
9798
$customerGroup = $this->groupRepository->getById((int)$id);

0 commit comments

Comments
 (0)