Skip to content
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

[GraphQl] Custom attribute aggregations should return store specific option values #28572

Closed
magento-engcom-team opened this issue Jun 5, 2020 · 4 comments · Fixed by #28647
Assignees
Labels
Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed PAP Partners acceleration program Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Project: GraphQL Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Milestone

Comments

@magento-engcom-team
Copy link
Contributor

Steps to reproduce:

  1. Create multiple stores with multiple store views ( for example: english and arabic storeviews) and choose either the English or the luma default store as the store view
  2. create a custom attribute that is visible in search and layered navigation. ( For test purpose, a drop down custom attribute " brand" with atleast couple options for different storeviews.
    For example: defaultBrand, englishBrand, arabicBrand etc)
  3. Add the custom attribute to attribute set
  4. Create a product and assign it to a category
  5. Use the below query to query for the product and aggregrations.
{
    products(filter: {
      		category_id: {eq: {$categoryId}},
    },
      pageSize:1,
      sort:{name:DESC})
  {
    items{
      id
      sku
      name
    }
    aggregations{
      label
      attribute_code
      count
      options{
        label
        value
        count
      }
    }
  }
}
{code}
Make sure no store code is passed in through the header.
Notice that the option value returned is the "arabicBrand"
Now remove this option from the attrribute form and re-run the query, you will see that the next option value : "englishBrand" now shows up and so on

Expected:
1. Since no store code is specified, the attribute option value for the default store should be returned( if store_code is passed in, appropriate option value should be returned)

Actual:
The last eav*attribute_option_value is always returned, since store*code is not honored.
{code:php}
"aggregations" :<
{...}
{...}
    {
          "label": "brand",
          "attribute_code": "brand",
          "count": 1,
          "options": [
            {
              "label": "arabicBrand2",
              "value": "44",
              "count": 1
            }
          ]
        }
>
@magento-engcom-team magento-engcom-team added Progress: ready for dev Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Jun 5, 2020
@m2-assistant
Copy link

m2-assistant bot commented Jun 5, 2020

Hi @magento-engcom-team. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

Please, add a comment to assign the issue: @magento I am working on this


@ghost ghost added this to Ready for Dev in Community Backlog Jun 5, 2020
@magento-engcom-team magento-engcom-team added the Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed label Jun 5, 2020
@nrkapoor nrkapoor moved this from Ready for Dev to Good First Issue in Community Backlog Jun 5, 2020
@nrkapoor nrkapoor added this to the 2.4.1 milestone Jun 5, 2020
@m2-assistant
Copy link

m2-assistant bot commented Jun 5, 2020

Hi @pmarjan. 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: 👇

    1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
      DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.
    1. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.
    1. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
    1. Verify that the issue is reproducible on 2.4-develop branch
      Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
      - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
      - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

@ghost ghost moved this from Good First Issue to Dev in Progress in Community Backlog Jun 5, 2020
@ghost ghost moved this from Dev in Progress to Ready for QA in Community Backlog Jun 8, 2020
@cpartica cpartica moved this from Ready for QA to Good First Issue in Community Backlog Jun 8, 2020
@gallyamov gallyamov self-assigned this Jun 8, 2020
@m2-assistant
Copy link

m2-assistant bot commented Jun 8, 2020

Hi @gallyamov. 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: 👇

    1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
      DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.
    1. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.
    1. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
    1. Verify that the issue is reproducible on 2.4-develop branch
      Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
      - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
      - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

@ghost ghost moved this from Good First Issue to Dev in Progress in Community Backlog Jun 8, 2020
@ghost ghost moved this from Dev in Progress to Ready for Dev in Community Backlog Jun 9, 2020
@ghost ghost moved this from Ready for Dev to Dev in Progress in Community Backlog Jun 9, 2020
@ghost ghost removed the Progress: ready for dev label Jun 9, 2020
@ghost ghost moved this from Dev in Progress to PR In Progress in Community Backlog Jun 9, 2020
@ghost ghost unassigned gallyamov Jun 9, 2020
@ghost ghost moved this from PR In Progress to Ready for QA in Community Backlog Jun 9, 2020
@ghost ghost assigned gallyamov Jun 9, 2020
@ghost ghost moved this from Ready for QA to PR In Progress in Community Backlog Jun 9, 2020
@ghost ghost moved this from PR In Progress to Dev in Progress in Community Backlog Jun 18, 2020
@gallyamov gallyamov moved this from Dev in Progress to PR In Progress in Community Backlog Jun 18, 2020
@magento-engcom-team magento-engcom-team added the Fixed in 2.4.x The issue has been fixed in 2.4-develop branch label Jun 19, 2020
@magento-engcom-team
Copy link
Contributor Author

Hi @magento-engcom-team. Thank you for your report.
The issue has been fixed in #28647 by @gallyamov in 2.4-develop branch
Related commit(s):

The fix will be available with the upcoming 2.4.1 release.

@ghost ghost moved this from PR In Progress to Done (last 30 days) in Community Backlog Jun 19, 2020
@magento-engcom-team magento-engcom-team added the Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. label Jun 20, 2020
@cpartica cpartica added the PAP Partners acceleration program label Jun 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed PAP Partners acceleration program Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Project: GraphQL Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
No open projects
Community Backlog
  
Done (last 30 days)
5 participants