Closed Quazz closed 1 year ago
It looks the problem is caused because of line_id not having NULL as default value (or otherwise the filter not accounting for empty string)
Relevant method.
line_id is not allowed to be NULL as per the db_schema. Therefore the best fix would be to change the filter in order item retrieval.
In addition to following method also needs to filter out empty line_id items (and all other methods similar to this one I guess)
Secondary question would be why near duplicate lines get added to the table? (only difference being no line_id and qty_paid 0 instead of 1)
They get added AFTER the order already exists and is paid for; but I don't know why or how.
Hello @Quazz,
Thank you for opening this issue and for the additional comments. We’ve checked this but it seems to be working fine on a plain Magento 2.4.5 install with only Mollie installed. Could it be that you have some modules installed that invoke the creation of the shipment that collides?
Especially step 5 is something we don’t recognize: As soon as the Mollie webhook marks the order as paid all order lines should be present. Next to that, a line_id
with a value of NULL
is something that shouldn’t happen in a regular installation.
Hello @Quazz,
Thank you for opening this issue and for the additional comments. We’ve checked this but it seems to be working fine on a plain Magento 2.4.5 install with only Mollie installed. Could it be that you have some modules installed that invoke the creation of the shipment that collides?
Especially step 5 is something we don’t recognize: As soon as the Mollie webhook marks the order as paid all order lines should be present. Next to that, a
line_id
with a value ofNULL
is something that shouldn’t happen in a regular installation.
The correct lines are correctly generated.
I have found the problem in the mean time, 3rd party extension that's calling https://github.com/mollie/magento2/blob/master/Service/Order/Lines/Order.php#L87
Not Mollie's fault, closing.
Describe the bug When trying to create a partial shipment you are returned to "Source selection" page for shipment.
Used versions
To Reproduce Steps to reproduce the behavior: When Mollie Order API is used for payment methods and multiple items are ordered each of which has their own sources related to them, it is impossible to create a partial shipment for them.
edit: Now that I'm fairly certain I found the cause, I should clarify it only happens if additional Mollie Order Lines are generated in the table, still don't know why or how this happens, but the error won't happen without it.
Example: item1 - sources: source1, source2 item2 - sources: source4
Partial shipments must be created in order to close the order, but it brings you back to source selection instead.
So steps:
Expected behavior The shipment is created successfully
Actual behavior You are brought back to the source selection. After some debugging by logging exceptions, the exception logged is:
Mollie API: [2022-09-27T11:22:38+0000] Error executing API call (422: Unprocessable Entity): Line 0 contains invalid data. The 'id' field is missing. Field: lines.0.id. Documentation: https://docs.mollie.com/overview/handling-errors
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Add any other context about the problem here.