-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Undefined index in TierPriceValidator.php #36431
Comments
Hi @clockworkgeek. Thank you for your report.
Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
For more details, review the Magento Contributor Assistant documentation. Add a comment to assign the issue: To learn more about issue processing workflow, refer to the Code Contributions.
🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket. ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
Hi @engcom-November. Thank you for working on this issue.
|
@magento give me 2.4-develop instance |
Hi @engcom-November. Thank you for your request. I'm working on Magento instance for you. |
Hi @engcom-November, here is your Magento Instance: https://b5a7424d7be4f10d33bc867c978abf1e.instances.magento-community.engineering |
✅ Jira issue https://jira.corp.adobe.com/browse/AC-7002 is successfully created for this GitHub issue. |
✅ Confirmed by @engcom-November. Thank you for verifying the issue. |
@magento I am working on this |
- fixed issue with undefined index customer group for changing tier price
- fixed issue with undefined index customer group for changing tier price
- fixed issue with undefined index customer group for changing tier price
- fixed issue with undefined index customer group for changing tier price
- fixed issue with undefined index customer group for changing tier price
- fixed issue with undefined index customer group for changing tier price
Preconditions and environment
Steps to reproduce
/rest/default/V1/integration/admin/token
/rest/V1/products/tier-prices
, attempt to POST a tier price for the new customer group but without the trailing space.Payload:
{
"prices": [
{
"price": 40,
"price_type": "fixed",
"website_id": 0,
"sku": "24-MB01",
"customer_group": "rvevgbbrrbr",
"quantity": 1,
"extension_attributes": {}
}
]
}
Expected result
A tier price should not be created because the customer group's name does not match. The API should return an error message like "No such entity with Customer Group".
Actual result
The API returns an error message like
Message: Notice: Undefined index: XXXXX in ~/public_html/vendor/magento/module-catalog/Model/Product/Price/Validation/TierPriceValidator.php on line 474"
Additional information
The problem occurs because the database equates the two customer group names although we know there is a single character difference. The method
TierPriceValidator::retrieveGroupValue
first assigns one name with:then accesses the same array with another name and triggers an undefined index error:
There are two ways to mitigate this that I can see.
LIKE
instead of=
because that respects trailing spaces.Release note
No response
Triage and priority
The text was updated successfully, but these errors were encountered: