Steps to Reproduce:
- Issue can be observed in Lotus Bugfest (attempting to edit a PO Line on an Opened Order)
- PO Line in Open Order is a 'Physical resource'
- A GET of PO line shows record has a "eresource" section https://okapi-bugfest-lotus.int.aws.folio.org/orders-storage/po-lines/236cd00a-30b1-40d4-988e-3922d8e9fca8
- Attempt to edit PO Line (changing a field which can be edited such as Receiving Note )
Field is edited and saved.
Receive error - protected fields can’t be modified
Response from PUT https://okapi-bugfest-lotus.int.aws.folio.org/orders/order-lines/236cd00a-30b1-40d4-988e-3922d8e9fca8 (per below returns a 400. response and references eresource fields)
"errors" : [
"total_records" : 1
The problem is in the order line type and the presence of extra elements in it:
- ("Electronic Resource") should contain only "eresource" element
- ("P/E Mix") should contain both "physical" and "eresource" elements
- ("Physical Resource") should contain only "physical" element
- ("Other") should contain only "physical" element"
Either a migration script is needed to correct PO Lines or update to logic for protected fields to ignore non applicable extra elements.
"A work around is to “unopen” the order and make the changes."