From f3541c674f1ed2a25866b7e5240682d6e1cad76b Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 28 Mar 2022 12:47:17 +0100 Subject: [PATCH] Bug 23681: (QA follow-up) Fix preferences Add the missing `.` and switch from `yes/no` to `1/0`. Signed-off-by: Katrin Fischer --- Koha/RestrictionType.pm | 4 ++-- .../bug_23681_add_PatronRestrictionTypes_syspref.perl | 2 +- .../prog/en/modules/admin/preferences/patrons.pref | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Koha/RestrictionType.pm b/Koha/RestrictionType.pm index a993942ef2..70946a6ff4 100644 --- a/Koha/RestrictionType.pm +++ b/Koha/RestrictionType.pm @@ -42,10 +42,10 @@ sub delete { my ( $self ) = @_; # Find out what the default is - my $default = Koha::RestrictionTypes->find({ dflt => 1 })->code; + my $default = Koha::RestrictionTypes->find({ is_system => 1 })->code; # Ensure we're not trying to delete a readonly type (this includes # the default type) - return 0 if $self->ronly == 1; + return 0 if $self->readonly == 1; # We can't use Koha objects here because Koha::Patron::Debarments # is not a Koha object. So we'll do it old skool my $rows = C4::Context->dbh->do( diff --git a/installer/data/mysql/atomicupdate/bug_23681_add_PatronRestrictionTypes_syspref.perl b/installer/data/mysql/atomicupdate/bug_23681_add_PatronRestrictionTypes_syspref.perl index 0319740215..a4d6323554 100644 --- a/installer/data/mysql/atomicupdate/bug_23681_add_PatronRestrictionTypes_syspref.perl +++ b/installer/data/mysql/atomicupdate/bug_23681_add_PatronRestrictionTypes_syspref.perl @@ -1,6 +1,6 @@ $DBversion = 'XXX'; # will be replaced by the RM if( CheckVersion( $DBversion ) ) { - $dbh->do( q| INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) VALUES ('PatronRestrictionTypes', '0', 'If enabled, it is possible to specify the "type" of patron restriction being applied', '', 'YesNo'); | ); + $dbh->do( q| INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) VALUES ('PatronRestrictionTypes', '0', 'If enabled, it is possible to specify the "type" of patron restriction being applied.', '', 'YesNo'); | ); SetVersion( $DBversion ); print "Upgrade to $DBversion done (Bug 23681 - Add PatronRestrictionTypes syspref)\n"; } 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 bec4235275..d3bf0e03d3 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 @@ -344,9 +344,9 @@ Patrons: - - pref: PatronRestrictionTypes choices: - yes: Allow - no: Don't allow - - "the type of patron restriction to be specified when applying manually" + 1: Allow + 0: Don't allow + - "the type of patron restriction to be specified when applying manually." Privacy: - -- 2.20.1