From 13b64e491b2b8e42fa3fec88f48d0ec3a4efa292 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Thu, 22 Feb 2024 22:21:46 +0000 Subject: [PATCH] Bug 36153: Increase allowed length of authorized value descriptions to 400 chars Sometimes 200 characters is not enough for a description. This patch increases the maximum length for authorized value descriptions to 400 characters To test: 1) Install database updates and restart services. You may need to rebuild schema files. 2) Go to Koha Administration -> Authorized values. 3) Choose an authorised value category and go to add a new value to it 4) Confirm the Description fields for both the OPAC and staff interface will allow you to input and save descriptions that are over 200 characters, up to 400 characters Sponsored-by: Education Services Australia SCIS --- ...se_authorised_value_description_lengths.pl | 30 +++++++++++++++++++ installer/data/mysql/kohastructure.sql | 4 +-- .../en/modules/admin/authorised_values.tt | 6 ++-- 3 files changed, 35 insertions(+), 5 deletions(-) create mode 100755 installer/data/mysql/atomicupdate/bug_36153_-_increase_authorised_value_description_lengths.pl diff --git a/installer/data/mysql/atomicupdate/bug_36153_-_increase_authorised_value_description_lengths.pl b/installer/data/mysql/atomicupdate/bug_36153_-_increase_authorised_value_description_lengths.pl new file mode 100755 index 00000000000..58671125572 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_36153_-_increase_authorised_value_description_lengths.pl @@ -0,0 +1,30 @@ +use Modern::Perl; + +return { + bug_number => "36153", + description => "Increase allowed length of authorized value descriptions", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + if ( column_exists( 'authorised_values', 'lib' ) ) { + $dbh->do( + q{ + ALTER TABLE authorised_values MODIFY COLUMN `lib` varchar(400) DEFAULT NULL COMMENT 'authorized value description as printed in the staff interface' + } + ); + + say $out "Increase length of 'authorised_values.lib' to 400 characters"; + } + + if ( column_exists( 'authorised_values', 'lib_opac' ) ) { + $dbh->do( + q{ + ALTER TABLE authorised_values MODIFY COLUMN `lib_opac` varchar(400) DEFAULT NULL COMMENT 'authorized value description as printed in the OPAC' + } + ); + + say $out "Increase length of 'authorised_values.lib_opac' to 400 characters"; + } + }, +}; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 16310f0f449..8ede0bac171 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1023,8 +1023,8 @@ CREATE TABLE `authorised_values` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'unique key, used to identify the authorized value', `category` varchar(32) NOT NULL DEFAULT '' COMMENT 'key used to identify the authorized value category', `authorised_value` varchar(80) NOT NULL DEFAULT '' COMMENT 'code use to identify the authorized value', - `lib` varchar(200) DEFAULT NULL COMMENT 'authorized value description as printed in the staff interface', - `lib_opac` varchar(200) DEFAULT NULL COMMENT 'authorized value description as printed in the OPAC', + `lib` varchar(400) DEFAULT NULL COMMENT 'authorized value description as printed in the staff interface', + `lib_opac` varchar(400) DEFAULT NULL COMMENT 'authorized value description as printed in the OPAC', `imageurl` varchar(200) DEFAULT NULL COMMENT 'authorized value URL', PRIMARY KEY (`id`), UNIQUE KEY `av_uniq` (`category`,`authorised_value`), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt index 4ec67e57d36..a33f5521556 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt @@ -150,11 +150,11 @@
  • - +
  • - +