[Koha-patches] [PATCH] bug 3099: fix copying patron info to deletedborrowers (DB rev 018)

Galen Charlton galen.charlton at liblime.com
Wed Apr 8 22:52:05 CEST 2009


Fixes the following problem:

When deleting a patron record via the intranet or the cleanborrowers tool,
patron records are deleted but are not copied to deletedborrowers.
C4::Members::MoveMemberToDeleted() fails with the following error:

deletemem.pl: DBD::mysql::st execute failed: Column count doesn't match value
count at row 1 at C4/Members.pm line 1672.,
---
 installer/data/mysql/kohastructure.sql |    1 +
 installer/data/mysql/updatedatabase.pl |    9 ++++++++-
 kohaversion.pl                         |    2 +-
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql
index d55e95c..27a5875 100644
--- a/installer/data/mysql/kohastructure.sql
+++ b/installer/data/mysql/kohastructure.sql
@@ -898,6 +898,7 @@ CREATE TABLE `deletedborrowers` (
   `altcontactaddress3` varchar(255) default NULL,
   `altcontactzipcode` varchar(50) default NULL,
   `altcontactphone` varchar(50) default NULL,
+  `smsalertnumber` varchar(50) default NULL,
   KEY `borrowernumber` (`borrowernumber`),
   KEY `cardnumber` (`cardnumber`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl
index 2b68f84..5651a35 100755
--- a/installer/data/mysql/updatedatabase.pl
+++ b/installer/data/mysql/updatedatabase.pl
@@ -2292,7 +2292,14 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
     'OPACSerialIssueDisplayCount', '3', '', 'Number of serial issues to display per subscription in the OPAC', 'Integer'
     );");
 
-    print "Upgrade to $DBversion done ( Updated table for Branch Transfer Limits)\n";
+    print "Upgrade to $DBversion done ( Updated table for Serials Display)\n";
+    SetVersion ($DBversion);
+}
+
+$DBversion = "3.01.00.018";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do("ALTER TABLE deletedborrowers ADD `smsalertnumber` varchar(50) default NULL");
+    print "Upgrade to $DBversion done (added deletedborrowers.smsalertnumber, missed in 3.00.00.091)\n";
     SetVersion ($DBversion);
 }
 
diff --git a/kohaversion.pl b/kohaversion.pl
index 8cc018f..c9d8661 100644
--- a/kohaversion.pl
+++ b/kohaversion.pl
@@ -10,7 +10,7 @@
 use strict;
 
 sub kohaversion {
-    our $VERSION = '3.01.00.017';
+    our $VERSION = '3.01.00.018';
     # version needs to be set this way
     # so that it can be picked up by Makefile.PL
     # during install
-- 
1.5.6.5




More information about the Koha-patches mailing list