- ๐ฎ๐นItaly nikolino
I have the same error but I don't use Commerce Repeat Order. When I modify an order by adding a new product I get this error.
Anyone have the same problem? - ๐ณ๐ฟNew Zealand luke.stewart
I've also hit this when using a custom module to duplicate a line Item when rescheduling a booking make via a custom implementation to drupal.org/project/bee.
I have a workaround which is to save the orderItem then add it to the order after it's been saved.
I thought perhaps I was doing things that I shouldn't have but spotted this so I think the more complete solution here is to ensure there is an original item.
- ๐ณ๐ฟNew Zealand luke.stewart
The MR just wraps the presave in a test to check if the original item exists. This will fix the fatal.
I suspect that what we actually want here is to set diff to "- $item->getQuantity()" if original is null. but I'm not familiar enough with this module to comment or comprehend. I'd definitely recommend testing the behaviour of the linked stock field before and after applying the above as a patch to ensure it is decrementing it where as before it would have issued a fatal. - ๐ณ๐ฑNetherlands ecvandenberg
For some reason I have the combination of this module with commerce repeat order working well.
This is the config that works well:- Drupal 10.3.10
- Commerce Core 8.x-2.40
- Commerce Simple Stock 8.x-1.2 with patch 3450194
- Commerce Repeat Order 8.x-2.2 with patch 3367273
Many months ago I had both patches installed too, but repeating an order resulted in errors.
Now it works great. I guess due to updates on other modules.