Bug 30144: (QA follow-up) Exclude servicing_instruction from order API representation
The servicing_instruction column was not mapped in Koha::Acquisition::Order->to_api_mapping, so it was exposed verbatim in the REST API order representation. Since api/v1/swagger/definitions/order.yaml does not declare this property and sets additionalProperties: false, any request touching the acquisitions/orders endpoint (e.g. the "Receive shipments" page) failed with a 500 error: "Properties not allowed: servicing_instruction". Exclude it from the API representation, consistent with the other EDIFACT-only columns (line_item_id, suppliers_reference_number, etc.) that are already excluded the same way. Test plan: 1) Go to a vendor page, create a basket, add an order line, and close the basket. 2) From the vendor page, click "Receive shipments". 3) Without this patch, the orders table fails to load with a 500 error mentioning "Properties not allowed: servicing_instruction". 4) With this patch applied, the orders table loads correctly. 5) prove t/db_dependent/api/v1/acquisitions_orders.t Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
parent
2e1f8b8660
commit
08a2e0475b
|
|
@ -654,6 +654,7 @@ sub to_api_mapping {
|
|||
parent_ordernumber => 'parent_order_id',
|
||||
quantityreceived => 'quantity_received',
|
||||
replacementprice => 'replacement_price',
|
||||
servicing_instruction => undef, # EDIFACT related
|
||||
sort1 => 'statistics_1',
|
||||
sort1_authcat => 'statistics_1_authcat',
|
||||
sort2 => 'statistics_2',
|
||||
|
|
|
|||
Loading…
Reference in New Issue