Closed lano-vargas closed 2 months ago
Hi @lano-vargas. Thank you for your report. To speed up processing of this issue, 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:
@magento give me 2.4-develop instance
- upcoming 2.4.x release@magento I am working on this
Join Magento Community Engineering Slack and ask your questions in #github channel. :warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting. :clock10: You can find the schedule on the Magento Community Calendar page. :telephone_receiver: 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.
@magento give me 2.4-develop instance
Hi @lano-vargas. Thank you for your request. I'm working on Magento instance for you.
Hi @lano-vargas, here is your Magento Instance: https://75e4640aa749e38caecb37dbbf0ae9ef.instances-prod.magento-community.engineering Admin access: https://75e4640aa749e38caecb37dbbf0ae9ef.instances-prod.magento-community.engineering/admin_e513 Login: 20061308 Password: e9e9ba250872
What is this version Magento ver. dev-develop. The issue is replicable on 2.4.7 can you give version 2.4.7 ? The issue might be fixed on your dev-develop
version
@magento give me 2.4.7 instance
Hi @engcom-Bravo. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
Area: XXXXX
label to the ticket, indicating the functional areas it may be related to.2.4-develop
branch@magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure. 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.Issue: Confirmed
once verification is complete. @magento give me 2.4-develop instance
Hi @engcom-Bravo. Thank you for your request. I'm working on Magento instance for you.
Hi @engcom-Bravo, here is your Magento Instance: https://75e4640aa749e38caecb37dbbf0ae9ef.instances-prod.magento-community.engineering Admin access: https://75e4640aa749e38caecb37dbbf0ae9ef.instances-prod.magento-community.engineering/admin_ba1b Login: 6e3b3aaf Password: 2793e56bf25e
Hi @lano-vargas,
Thanks for your reporting and collaboration.
We have verified the issue in Latest 2.4-develop instance and the issue is not reproducible.Kindly refer the screenshots.
We are not getting any aggregation error.It might be possible issue got fixed in Latest 2.4-develop instance.
Thanks.
Something weird going on here. It's a specific scenario issue here, I'm not entirely sure how to completely replicate this but I have done is mess about the attribute+options creation/deletion and products attribute options assignment creation/deletion
It appears that when an attribute option is deleted but there are still products assigned to it the graphl returns some extra array of object which appear to be the product that were assigned to previous attribute that was deleted.
It return the attribute id on both field e.g:
{
"count": 1,
"label": "417",
"value": "417",
"__typename": "AggregationOption"
}
in Label it should return a string name such as colour
etc...
@magento give me 2.4-develop instance
Hi @engcom-Bravo. Thank you for your request. I'm working on Magento instance for you.
Hi @engcom-Bravo, here is your Magento Instance: https://75e4640aa749e38caecb37dbbf0ae9ef.instances-prod.magento-community.engineering Admin access: https://75e4640aa749e38caecb37dbbf0ae9ef.instances-prod.magento-community.engineering/admin_3a6b Login: 1a20dbae Password: 05c5bb00b9f1
Hi @lano-vargas,
Thanks for your update.
We have verified the issue in Latest 2.4-develop instance and the issue is not reproducible.Kindly refer the screenshots.
We have created attribute and assigned to some of the products and after that deleted that attribute.
There was no error.We are getting aggregations.
Hence we are closing this issue.
Thanks.
Just wanted to chime in and let you now that I am also observing this exact same error on a 2.4.7 instance. Will try and see if I can help with the reproduction.
Looks like this error was happening due to certain products having non-existent option ID references for the color
attribute. This was probably the result of a botched data migration in our clients project.
I have(had) the same issue. Fixed it by changing the code.
/vendor/magento/module-catalog-graph-ql/DataProvider/Product/LayeredNavigation/Builder/Attribute.php line 100
public function build(AggregationInterface $aggregation, ?int $storeId): array
{
$attributeOptions = $this->getAttributeOptions($aggregation, $storeId);
$result = [];
foreach ($this->getAttributeBuckets($aggregation) as $bucket) {
$bucketName = $bucket->getName();
$attributeCode = \preg_replace('~_bucket$~', '', $bucketName);
$attribute = $attributeOptions[$attributeCode] ?? [];
$result[$bucketName] = $this->layerFormatter->buildLayer(
$attribute['attribute_label'] ?? $bucketName,
\count($bucket->getValues()),
$attribute['attribute_code'] ?? $bucketName,
isset($attribute['position']) ? $attribute['position'] : null
);
$options = $this->getSortedOptions($bucket, isset($attribute['options']) ? $attribute['options'] : []);
foreach ($options as $option) {
$result[$bucketName]['options'][] = $this->layerFormatter->buildItem(
$option['label'],
$option['value'],
$option['count']
);
}
}
return $result;
}
I don't think this is the way to go. But works for now
Preconditions and environment
Steps to reproduce
Expected result
Not to return error:
aggregations to return data but it's null
Actual result
Additional information
Upon checking exception log:
Release note
No response
Triage and priority