Skip to content

[Issue] Fix: propagate stock validation message in QuantityValidator error info #40569

@m2-assistant

Description

@m2-assistant

This issue is automatically created based on existing pull request: #40556: Fix: propagate stock validation message in QuantityValidator error info


Description (*)

  • Fix missing error message when QuantityValidator reports a stock error that already has a stockStateResult with hasError = true
  • Previously, addErrorInfo() was called without a message, causing silent errors in consumers like the GraphQL cart mutations
  • Now propagates $stockResult->getMessage() with a fallback to the default "out of stock" message

Manual testing scenarios (*)

  • Add an out-of-stock product to cart via GraphQL and verify the error response contains a descriptive message
  • Verify standard storefront "out of stock" behavior is unchanged
  • Run existing CatalogInventory unit/integration tests

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Ready for Confirmation

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions