From 870abd703bf0536d81191651f83146017ebf9134 Mon Sep 17 00:00:00 2001 From: Jesse Weaver Date: Tue, 3 Nov 2009 21:27:30 -0700 Subject: [PATCH] Fix handling of pref defaults (#3747, #3588) --- admin/preferences.pl | 4 ++-- .../prog/en/modules/admin/preferences/cataloguing.pref | 2 +- .../prog/en/modules/admin/preferences/patrons.pref | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/admin/preferences.pl b/admin/preferences.pl index c359d32a46..146fe3f8fc 100755 --- a/admin/preferences.pl +++ b/admin/preferences.pl @@ -126,9 +126,9 @@ sub TransformPrefsToHTML { my $name = $piece->{'pref'}; if ( $name ) { - my $row = $dbh->selectrow_hashref( "SELECT value FROM systempreferences WHERE variable = ?", {}, $name ); + my $row = $dbh->selectrow_hashref( "SELECT value, type FROM systempreferences WHERE variable = ?", {}, $name ); my $value; - if ( !defined( $row ) && defined( $piece->{'default'} ) ) { + if ( ( !defined( $row ) || ( !defined( $row->{'value'} ) && $row->{'type'} ne 'YesNo' ) ) && defined( $piece->{'default'} ) ) { $value = $piece->{'default'}; } else { $value = $row->{'value'}; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref index a4b2fd8522..5bdc1e657d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref @@ -70,7 +70,7 @@ Cataloging: incremental: generated in the form 1, 2, 3. annual: generated in the form <year>-0001, <year>-0002. hbyymmincr: generated in the form <branchcode>yymm0001. - OFF: not generated automatically. + "OFF": not generated automatically. Display: - - 'Separate multiple displayed authors, series or subjects with ' 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 c207cd1d6a..3ff3628935 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 @@ -1,4 +1,4 @@ -Patron: +Patrons: - - List - pref: AddPatronLists @@ -13,6 +13,7 @@ Patron: no: "Don't send" - an email to newly created patrons with their account details at their - pref: AutoEmailPrimaryAddress + default: "OFF" choices: email: home emailpro: work -- 2.39.5