https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23023 --- Comment #1 from Adolfo Rodríguez Taboada <adolfo.rodriguez@xercode.es> --- Created attachment 212988 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212988&action=edit Bug 23023: Do not receive serial issues if their items cannot be created When receiving a serial issue that creates an item (subscription with "Create an item record when receiving this serial"), the issue status is changed before the item is created. If the item cannot be created because its barcode already exists, the error is shown but the issue remains received: the next issue is generated, the issue is added to the received list and no item is linked to it. The error page also shows the issue as expected, which does not match what has been saved. This patch saves the issues and their items in a single transaction, which is rolled back if any item fails, so nothing is saved and the page shows the real state. Steps to follow: 1. Create a record with an item with barcode "DUP". 2. Create a subscription for this record with "Create an item record when receiving this serial" checked. 3. Receive the first issue: set its status to "Arrived" and, in the item form, set barcode "DUP". Save. 4. Note the error "Barcode not unique for serialseq ...". 5. Go to the serial collection: the issue is "Arrived", the next issue has been generated and there is no linked item. 6. Apply the patch and restart services. 7. Delete the issues of the subscription and generate the first issue again (or create a new subscription) and repeat 3. 8. Note the error, now with "No changes have been saved.": the issue is still "Expected" and the next issue has not been generated. 9. Save again with a barcode that does not exist: the issue is received, the next one is generated and the item is linked to it. -- You are receiving this mail because: You are watching all bug changes.