If we remove the link to a computer from the Order. We get one successful message and one error complaining that some field cannot be deleted as they are part of an order.
Most field in the infocom of the computer are still there. Order Date and Delivery Date are set to null but everything else stay (supplier, order number, invoice number, budget, value, etc…).
I believe the fix would be as simple as changing the order of operation in the function deleteLinkWithItem.
For example, moving this:
$this->removeInfoComRelatedToOrder($itemtype, $items_id);
After that:
if ($items_id != 0) { $input = $detail->fields; $input["items_id"] = 0; $detail->update($input); } else { Session::addMessageAfterRedirect(__("One or several selected rows haven't linked items", "order"), true, ERROR); }
https://github.com/pluginsGLPI/order/blob/9a6796fe1b749ff9b18ed02b4ea2d0bd28217c97/inc/link.class.php#L1089-L1098
If we remove the link to a computer from the Order. We get one successful message and one error complaining that some field cannot be deleted as they are part of an order.
Most field in the infocom of the computer are still there. Order Date and Delivery Date are set to null but everything else stay (supplier, order number, invoice number, budget, value, etc…).
I believe the fix would be as simple as changing the order of operation in the function deleteLinkWithItem.
For example, moving this:
$this->removeInfoComRelatedToOrder($itemtype, $items_id);
After that:if ($items_id != 0) { $input = $detail->fields; $input["items_id"] = 0; $detail->update($input); } else { Session::addMessageAfterRedirect(__("One or several selected rows haven't linked items", "order"), true, ERROR); }
…may fix the issue