Skip to content

Conversation

@johan-lindahl
Copy link

@johan-lindahl johan-lindahl commented Feb 17, 2021

Description (*)

If SKU is numeric, PHP will auto type to integer and throw a Type Error exception when the consumer process a job including such SKU.

Fixed Issues (if relevant)

Not aware of any open issue

Manual testing scenarios (*)

  1. Queue a message with the following topic and body
topic_name: inventory.reservations.updateSalabilityStatus
body: {"skus":["15438","15439"],"stock":6}
  1. Start a consumer
    bin/magento queue:consumers:start inventory.reservations.updateSalabilityStatus

  2. Watch the following error message in your log or termnal

PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Magento\InventoryIndexer\Model\Queue\UpdateIndexSalabilityStatus\IndexProcessor::getIndexSalabilityStatus() must be of the type string, int given, called in /home/magento2/Projects/harald-nyborg/magento2/vendor/magento/module-inventory-indexer/Model/Queue/UpdateIndexSalabilityStatus/IndexProcessor.php on line 119 and defined in /home/magento2/Projects/harald-nyborg/magento2/vendor/magento/module-inventory-indexer/Model/Queue/UpdateIndexSalabilityStatus/IndexProcessor.php:136
Stack trace:
#0 /home/magento2/Projects/harald-nyborg/magento2/vendor/magento/module-inventory-indexer/Model/Queue/UpdateIndexSalabilityStatus/IndexProcessor.php(119): Magento\InventoryIndexer\Model\Queue\UpdateIndexSalabilityStatus\IndexProcessor->getIndexSalabilityStatus(15438, 6)
#1 /home/magento2/Projects/harald-nyborg/magento2/vendor/magento/module-inventory-indexer/Model/Queue/UpdateIndexSalabilityStatus/IndexProcessor.php(97): Magento\InventoryIndexer\Model\Queue\UpdateIndexSalabilityStatus\ in /home/magento2/Projects/harald-nyborg/magento2/vendor/magento/module-inventory-indexer/Model/Queue/UpdateIndexSalabilityStatus/IndexProcessor.php on line 136

Questions or comments

I am not sure which branch this should go into. The problem is on latest 2.3.6-p1 which is still popular. It would be great to get this fix into the upcoming 2.3.7 or other service releases.

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)
  • All automated tests passed successfully (all builds are green)

Copy link
Contributor

@Stepa4man Stepa4man left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @johan-lindahl
Thanks for your contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Reviewer Approved

Development

Successfully merging this pull request may close these issues.

3 participants