@@ -, +, @@
where each note is greater than 150 characters.
---
C4/Serials.pm | 6 ++++++
installer/data/mysql/kohastructure.sql | 4 ++--
installer/data/mysql/updatedatabase.pl | 8 ++++++++
3 files changed, 16 insertions(+), 2 deletions(-)
--- a/C4/Serials.pm
+++ a/C4/Serials.pm
@@ -483,6 +483,7 @@ sub GetSubscriptionsFromBiblionumber {
$subs->{startdate} = format_date( $subs->{startdate} );
$subs->{histstartdate} = format_date( $subs->{histstartdate} );
$subs->{histenddate} = format_date( $subs->{histenddate} );
+ $subs->{opacnote} ||= q{};
$subs->{opacnote} =~ s/\n/\
/g;
$subs->{missinglist} =~ s/\n/\
/g;
$subs->{recievedlist} =~ s/\n/\
/g;
@@ -1081,6 +1082,11 @@ returns the number of rows affected
sub ModSubscriptionHistory {
my ( $subscriptionid, $histstartdate, $enddate, $recievedlist, $missinglist, $opacnote, $librariannote ) = @_;
+
+ $recievedlist ||= q{};
+ $missinglist ||= q{};
+ $opacnote ||= q{};
+
my $dbh = C4::Context->dbh;
my $query = "UPDATE subscriptionhistory
SET histstartdate=?,histenddate=?,recievedlist=?,missinglist=?,opacnote=?,librariannote=?
--- a/installer/data/mysql/kohastructure.sql
+++ a/installer/data/mysql/kohastructure.sql
@@ -2046,8 +2046,8 @@ CREATE TABLE `subscriptionhistory` (
`histenddate` date default NULL,
`missinglist` longtext NOT NULL,
`recievedlist` longtext NOT NULL,
- `opacnote` varchar(150) NOT NULL default '',
- `librariannote` varchar(150) NOT NULL default '',
+ `opacnote` text NULL,
+ `librariannote` text NULL,
PRIMARY KEY (`subscriptionid`),
KEY `biblionumber` (`biblionumber`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--- a/installer/data/mysql/updatedatabase.pl
+++ a/installer/data/mysql/updatedatabase.pl
@@ -7010,6 +7010,14 @@ CREATE TABLE IF NOT EXISTS borrower_files (
SetVersion($DBversion);
}
+$DBversion = "3.13.00.XXX";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do(q{ALTER TABLE subscriptionhistory CHANGE opacnote opacnote TEXT NULL});
+ $dbh->do(q{ALTER TABLE subscriptionhistory CHANGE librariannote librariannote TEXT NULL});
+ print "Upgrade to $DBversion done (Bug 10215 - Increase the size of opacnote and librariannote for table subscriptionhistory)\n";
+ SetVersion ($DBversion);
+}
+
=head1 FUNCTIONS
=head2 TableExists($table)
--