Closed
Description
Preconditions (*)
- Magento Open Source 2.4-develop, 2.3.5-p1 fresh install
Steps to reproduce (*)
- Create first product (name: test-01).
- Create another product (name: test-02). + Add test-01 as related products
- Disable product test-01
- Send graphql request to get relate product
curl -X POST \
http://magento-2-fresh/graphql \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-d '{"query":" query productDetail {\n productDetail: products(pageSize: 10, currentPage: 1, search: \"\") {\n items {\n id\n sku\n name\n related_products {\n id\n sku\n url_key\n }\n }\n }\n }","operationName":"productDetail"}'
- Graphql format
query productDetail {
productDetail: products(pageSize: 10, currentPage: 1, search: "") {
items {
id
sku
name
related_products {
id
sku
url_key
}
}
}
}
Expected result (*)
- json response with no error
{
"data": {
"productDetail": {
"items": [
{
"id": 2,
"sku": "Test-02",
"name": "Test-02",
"related_products": []
}
]
}
}
}
Actual result (*)
{
"errors": [
{
"debugMessage": "Notice: Undefined offset: 1 in /app/vendor/magento/module-related-product-graph-ql/Model/Resolver/Batch/AbstractLikedProducts.php on line 115",
"message": "Internal server error",
"extensions": {
"category": "internal"
},
"locations": [
{
"line": 7,
"column": 9
}
],
"path": [
"productDetail",
"items",
0,
"related_products"
]
}
],
"data": {
"productDetail": {
"items": [
{
"id": 2,
"sku": "Test-02",
"name": "Test-02",
"related_products": null
}
]
}
}
}
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Metadata
Metadata
Assignees
Labels
The issue has been fixed in 2.4-develop branchGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 1 Passed. Automatic verification of issue format passedGate 4. Acknowledged. Issue is added to backlog and ready for developmentA defect with this priority could have functionality issues which are not to expectations.Indicates original Magento version for the Issue report.The issue has been reproduced on latest 2.4-develop branchMajor restrictions or short-term circumventions are required until a fix is available.
Type
Projects
Status
Done