magento / magento/inventory

[Issue] fix: allow skus with ':'s

Open
#3,438 0 comments 0 reactions 0 assignees View on GitHub
Issue: needs update
Dominant language
PHP
Stars
357
Forks
262
PR merge metrics
No merged PRs in 30d

Description

This issue is automatically created based on existing pull request: magento/inventory#3404: fix: allow skus with ':'s

---------
### Description (*)
When running `bin/magento inventory:reservation:create-compensations` if the sku contains ':' the regex breaks, and then the entities can't be loaded.
BEFORE
![image](https://github.com/magento/inventory/assets/6369163/ed5e664e-3177-4b90-a93f-f9db30b7c4fa)
AFTER FIX
![image](https://github.com/magento/inventory/assets/6369163/c84179e1-f0e2-41b7-bc7c-7e8bd8d04a2a)

### Fixed Issues (if relevant)

### Manual testing scenarios (*)
This is difficult as it requires you to have a reservation inconsistency for a product with a sku with a ';' in it. But if this is the case simply run:
`php bin/magento inventory:reservation:create-compensations`
(with the compensation string)
You will get error like: "Get EntityId on null"

### Questions or comments

### Contribution checklist (*)
- [x] Pull request has a meaningful description of its purpose
- [x] 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)

Contributor guide

Open the contributing guide

Research direction

Start with the `bin/magento inventory:reservation:create-compensations` entry point and inspect how compensation strings are parsed when a SKU contains `:`. Reproduce the failure with a reservation inconsistency for such a SKU, then verify that the command loads the entity and creates the compensation without the null-entity error. An existing pull request, magento/inventory#3404, already covers this issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.