Skip to content

[GraphQL] route query ignoring whether a product/category is disabled #36268

Open
@t-heuser

Description

@t-heuser

Preconditions and environment

  • Magento version: 2.4.5

Steps to reproduce

  • Create a new category or product (keep it enabled)
  • Disable the category or product afterwards
  • Execute the following query (replace placeholder with your url key):
query route {
  route(url: "XXXXX") {
    type
    relative_url
  }
}

Expected result

The product/category is not returned:

{
  "data": {
    "route": null
  }
}

Actual result

The product/category is returned:

{
  "data": {
    "route": {
      "type": "CATEGORY",
      "relative_url": "test123/"
    }
  }
}

Additional information

When looking through the resolver for the route query I find nothing that checks whether a product/category is disabled.
Such a check added because otherwise there are a lot of issues as every other query of Magento respects whether a product is disabled.

In 2021 i opened a ticket on the same topic for the old urlResolver which was removed in favor of route. The issue was not reproducible back then but is now.
#33447

Release note

No response

Triage and priority

  • 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

No one assigned

    Labels

    Area: ProductComponent: GraphQLGraphQLIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: PR CreatedIndicates that Pull Request has been created to fix issueProgress: PR in progressReported on 2.4.5Indicates 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

    Pull Request In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions