Open Silarn opened 2 years ago
This did indeed appear to be a potential cause, however I'm somewhat confused about the fact that were were almost twice as many SKUs with trailing spaces in the inventory_source_item table than there were in the catalog_product_entity table.
Is this some sort of core Magento issue?
@Silarn I've never come across it myself. It may be a core magento issue that somehow mangles these skus, or perhaps some way of creating the products / stock inventory that we don't hit during our REST API product creation flow š¤·
We have recently come accross this issue as well and it seems that it is caused by the normalizeSku function. Products with sku containing non-word characters messing with array indexing causing exception notice in line 127: $itemsTdDeliver[$normalizedSku] -= $qtyToDeduct;
We fixed the issue by modifying normalizeSku function in order to remove non-words characters from sku and the error was fixed:
private function normalizeSku(string $sku): string { return preg_replace("/[^\w\d]/","",mb_convert_case($sku, MB_CASE_LOWER, 'UTF-8')); }
This is only affecting orders occasionally, but it seems to be stopping the order after the transaction is complete during the various 'after order' plugins. (Emails and a few other post-order functions are not running.)
So far this has happened only on orders with bundles, but not for every one. If I knew how to replicate it I would see if I could step through the code.
Here's a stacktrace.