Skip to content

GraphQl Get Product Filter By Category display incorrect label  #29635

Closed
@lano-vargas

Description

@lano-vargas

Preconditions (*)

  1. Magento2.3.5 instance

Steps to reproduce (*)

  1. Set up multistore view at most 2 or 3 store views
  2. Add options for Color at red, green etc.
  3. Add labels for all store views.
  4. Have at least 2 or 3 products and add option Color attribute.
  5. Query getProductFiltersByCategory
query getProductFiltersByCategory($categoryIdFilter: FilterEqualTypeInput!) {
    products(filter: { category_id: $categoryIdFilter }) {
        aggregations {
            label
            count
            attribute_code
            options {
                label
                value
            }
        }
    }
}
{"categoryIdFilter": {"eq": "4"}}

Expected result (*)

  1. [Screenshots, logs or description]
  2. I expected to return the Default Store View Label.

Actual result (*)

  1. [Screenshots, logs or description]

Screenshot 2020-08-18 at 12 05 21

It return last item in the array.

Screenshot 2020-08-18 at 12 42 50

ref: https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/CatalogGraphQl/DataProvider/Product/LayeredNavigation/AttributeOptionProvider.php

Possible cause issue:

$result[$option['attribute_code']]['options'][$option['option_id']] = $option['option_label'];

my.log shows
$logger->info( $option );
Screenshot 2020-08-18 at 14 20 02


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

Labels

Area: FrameworkComponent: GraphQLGraphQLIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: doneProject: GraphQLReported on 2.4.xIndicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

Type

No type

Projects

  • Status

    Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions