-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error while creating a creditmemo with numerical SKU #2429
Comments
Hi @HS-Fachmarkt! Thank you for your report, but I could not reproduce this issue. May you give more details, please? Do you have any 3-d part extensions installed? |
No 3-d party extension affecting the ordermanagement installed. |
We're also running into the same issue on Magento 2.3.2.
|
@smoskaluk The reason is, that PHP doesn't allow numerical strings as array keys. Those are casted to integer values automatically. Just add a cast back to string for that case (as @julianvdrielen suggested). |
@ishakhsuvarov I have that issue in my production env and also in my development env. I've requested a test instance from the magento bot, but (as you mentioned) I was not able to reproduce the issue. But I have no idea if this inventory repository is included in those test builds. Just install 2.3.2 (not a branch) by using composer and you will be able to reproduce that behaviour. |
We are also facing same issue on the same exact conditions described on this issue. |
Closing as there is another ticket on the same matter with a proposed solution. |
Preconditions (*)
Steps to reproduce (*)
Expected result (*)
Actual result (*)
AH01071: Got error 'PHP message: PHP Fatal error: Uncaught TypeError: Argument 1 passed to
Magento\InventorySales\Model\ReturnProcessor
GetInvoicedItemsPerSourceByPriority::getSourceCodeWithHighestPriorityBySku()
must be of the type string, integer given, called in
/var/www/site.pl/vendor/magento/module-inventory-sales/Model/ReturnProcessor/GetInvoicedItemsPerSourceByPriority.php
on line 121 and defined in
/var/www/site.pl/vendor/magento/module-inventory-sales/Model/ReturnProcessor/GetInvoicedItemsPerSourceByPriority.php:143
Stack trace:
#0 /var/www/site.pl/vendor/magento/module-inventory-sales/Model/ReturnProcessor/GetInvoicedItemsPerSourceByPriority.php(121): Magento\InventorySales\Model\ReturnProcessor
GetInvoicedItemsPerSourceByPriority->getSourceCodeWithHighestPriorityBySku(22344, 3)\n
#1 /var/www/site.pl/vendor/magento/module-inventory-sales/Model/ReturnProcessor/GetInvoicedItemsPerSourceByPriority.php(108...\n', referer: https://www.site.pl/admin/sales/order_creditmemo/new/key/3742f721b99fbfd664888250eb427ed557c6a049691c7381dbac67aaf696f17c/order_id/495/
This function requires the sku as string. A sku with digits only will be a integer here and leads to this error.
The text was updated successfully, but these errors were encountered: