From d75da67aef28f7ee14d106021ec58b8749d944fc Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 9 Aug 2022 12:30:40 +0200 Subject: [PATCH] Bug 31297: Fix creation of new subscription pattern from edit subscription When editing a subscription there is the possibility to create a new subscription pattern. But this form does not have a "description" for this pattern, and the DBMS does not allow description to be NULLed. Error is: DBI Exception: DBD::mysql::st execute failed: Field 'description' doesn't have a default value This patch takes the shortest path to fix the 500 error (with no feedback sent to the end user), but there are other better ways to fix it: 1. Allow subscription_numberpatterns.description to be NULL, or 2. Add a description field on the form Test plan: Create a new subscription, on the second page click "show advanced pattern", then "Modify pattern", enter a name and click "Save as new pattern" --- serials/create-numberpattern.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/serials/create-numberpattern.pl b/serials/create-numberpattern.pl index a28ef0d4155..3c5055bd1f9 100755 --- a/serials/create-numberpattern.pl +++ b/serials/create-numberpattern.pl @@ -42,6 +42,7 @@ foreach (qw/ numberingmethod label1 label2 label3 add1 add2 add3 } # patternname is label in database $numberpattern->{'label'} = $input->param('patternname'); +$numberpattern->{'description'} = $input->param('patternname'); # Check if pattern already exist in database my $dbh = C4::Context->dbh; -- 2.25.1