From 90cd26fb2ec6187724c414a920413933263b274f Mon Sep 17 00:00:00 2001 From: Baptiste Wojtkowski Date: Mon, 5 Aug 2024 15:24:51 +0200 Subject: [PATCH] Bug 37569: Fix the way serials are returned Serials cannot be edited if there is no history associated to the serial. Fetching a subscription matching a given serialnumber results in an hashref containing two fields named serial number. One of them is undef and is used by the form and is therefore not submitted at the end. This is not supposed to happen since creating an exemplary automatically creates a new exemplary, but if serials are created through DB, they are not editable. Test plan: 1 - Create a serial 2 - In the database remove there history associated with the serial 3 - Try and edit serial, at the end of the form, it will result in "serial not found" 4 - Apply patch 5 - Redo 3 and notice it now works --- C4/Serials.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/C4/Serials.pm b/C4/Serials.pm index 8982eabfe69..52041cc76c4 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -276,7 +276,8 @@ sub GetSubscription { aqbooksellers.name AS aqbooksellername, biblio.title AS bibliotitle, biblio.subtitle AS bibliosubtitle, - subscription.biblionumber as bibnum + subscription.biblionumber as bibnum, + subscription.subscriptionid as subscriptionid FROM subscription LEFT JOIN subscriptionhistory ON subscription.subscriptionid=subscriptionhistory.subscriptionid LEFT JOIN aqbooksellers ON subscription.aqbooksellerid=aqbooksellers.id -- 2.43.0