From 6b29d29cae6266fb39d4fd30c5b884ba714f118d Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 1 Jun 2026 16:55:14 +0100 Subject: [PATCH] Bug 42734: Add autoMemberNumValue to patrons sysprefs UI with caution note This patch adds autoMemberNumValue to the Patrons system preferences page immediately below autoMemberNum, so superlibrarians can view and correct a runaway counter without needing vendor support. The entry carries a caution note explaining: - the value is managed automatically and should not normally be changed - Koha generates the next cardnumber from max(counter, live_db_max), so lowering the counter only has effect once the patron responsible for the inflated number has been deleted or had their cardnumber corrected first - the risk of setting it too low: potential re-issuance of a previously used cardnumber, which may grant a new patron access to third-party services linked to the original holder Signed-off-by: David Nind Signed-off-by: Lisette Scheer Signed-off-by: Lucas Gass --- .../prog/en/modules/admin/preferences/patrons.pref | 5 +++++ t/db_dependent/check_sysprefs.t | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref index 959a031f53..301c46c36b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref @@ -307,6 +307,11 @@ Patrons: 0: "Don't" - default the card number field on the patron addition screen to the next available card number (for example, if the largest currently used card number is 26345000012941, then this field will default to 26345000012942). - 'NOTE: If autoMemberNum is enabled, the system preference BorrowerMandatoryField must not contain the field cardnumber.' + - + - The next auto-generated card number will be at least + - pref: autoMemberNumValue + class: integer + - 'CAUTION: This value is managed automatically by Koha and should not normally be changed. Koha always generates the next card number from whichever is higher: this counter or the largest numeric card number currently in use. As a result, lowering this counter only has an effect once the patron responsible for the inflated number has been deleted or had their card number corrected. Only lower it if the counter has been inflated by an accidentally-entered barcode or a large test card number and you are certain the value you set will never match a card number held by any current or deleted patron. Setting it too low risks re-issuing a previously used card number, which may grant a new patron unintended access to third-party services linked to the original holder.' - - Card numbers for patrons must be - pref: CardnumberLength diff --git a/t/db_dependent/check_sysprefs.t b/t/db_dependent/check_sysprefs.t index 4a0313e18c..3a29375a82 100755 --- a/t/db_dependent/check_sysprefs.t +++ b/t/db_dependent/check_sysprefs.t @@ -40,7 +40,6 @@ my @exceptions = qw( UsageStatsID UsageStatsLastUpdateTime UsageStatsPublicID - autoMemberNumValue ); my @sysprefs_in_sql_file = Koha::Devel::Sysprefs->new->get_sysprefs_from_file();