-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Closed
Copy link
Labels
Fixed in 2.4.xThe issue has been fixed in 2.4-develop branchThe issue has been fixed in 2.4-develop branchIssue: ready for confirmationPriority: P3May be fixed according to the position in the backlog.May be fixed according to the position in the backlog.Progress: doneSeverity: S3Affects non-critical data or functionality and does not force users to employ a workaround.Affects non-critical data or functionality and does not force users to employ a workaround.duplicate
Description
Preconditions
- Any Magento version (tested on all significant releases, 2.1, 2.2, 2.3)
- Reproduced on 2.4-develop
- #magento2/27411 was closed while it's a verified and open bug. You can't do that. Opening this as a new issue.
Steps to reproduce
- Add a product either through migration, a custom importer or directly in the database.
- Leave out the field SKU (in other words, leave it NULL).
- Go to the product edit page in the backoffice.
Expected result
- Should not be possible to add the product OR should not throw an error in the backoffice.
Actual result
- Product is added without issues.
- When attempting to edit the product in the backoffice the following error is thrown:
Fatal error: Uncaught TypeError: Argument 1 passed to Magento\Catalog\Model\ProductRepository::prepareSku() must be of the type string, null given, called in /vendor/magento/module-catalog/Model/ProductRepository.php on line 790 and defined in /vendor/magento/module-catalog/Model/ProductRepository.php:800 Stack trace: #0 /vendor/magento/module-catalog/Model/ProductRepository.php(790): Magento\Catalog\Model\ProductRepository->prepareSku(NULL) #1 /vendor/magento/module-catalog/Model/ProductRepository.php(349): Magento\Catalog\Model\ProductRepository->saveProductInLocalCache(Object(Magento\Catalog\Model\Product\Interceptor), '3e07f167255019f...') #2 /vendor/magento/module-catalog/Model/ProductRepository.php(314): Magento\Catalog\Model\ProductRepository->cacheProduct('3e07f167255019f...', Object(Magento\Catalog\Model\Product in /vendor/magento/module-catalog/Model/ProductRepository.php on line 800
Metadata
Metadata
Assignees
Labels
Fixed in 2.4.xThe issue has been fixed in 2.4-develop branchThe issue has been fixed in 2.4-develop branchIssue: ready for confirmationPriority: P3May be fixed according to the position in the backlog.May be fixed according to the position in the backlog.Progress: doneSeverity: S3Affects non-critical data or functionality and does not force users to employ a workaround.Affects non-critical data or functionality and does not force users to employ a workaround.duplicate