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 <david@davidnind.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Martin Renvoize 2026-06-01 16:55:14 +01:00 committed by Lucas Gass
parent 15783cbc0e
commit 6b29d29cae
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
2 changed files with 5 additions and 1 deletions

View File

@ -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).
- '<strong>NOTE:</strong> If <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=autoMemberNum">autoMemberNum</a> is enabled, the system preference <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=BorrowerMandatoryField">BorrowerMandatoryField</a> must not contain the field <code>cardnumber</code>.'
-
- The next auto-generated card number will be at least
- pref: autoMemberNumValue
class: integer
- '<strong>CAUTION:</strong> 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

View File

@ -40,7 +40,6 @@ my @exceptions = qw(
UsageStatsID
UsageStatsLastUpdateTime
UsageStatsPublicID
autoMemberNumValue
);
my @sysprefs_in_sql_file = Koha::Devel::Sysprefs->new->get_sysprefs_from_file();