From 4f3df5d1d2b19bd6e6b5a6e6784006f5cc6980a7 Mon Sep 17 00:00:00 2001 From: Chris Nighswonger Date: Fri, 25 Jul 2008 10:37:50 -0500 Subject: [PATCH] kohabug 2219 Corrects inconsistent use of subscription.serialsadditems column From the bug report: The serialsadditems syspref was ostensibly removed in DB rev 071 (http://git.koha.org/cgi-bin/gitweb.cgi?p=Koha;a=commit;h=5c41ae54e68866f9661e853376537059f4d83f70) in favor of a new serialsadditems column in the subscription table. However, this removal was incomplete. It is still created for new installations by: installer/data/mysql/en/mandatory/sysprefs.sql installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql and is used in serials/serials-recieve.pl serials/serials-edit.pl admin/systempreferences.pl Since the system preference was not removed from the sample data scripts, it is necessary to add another DB rev to remove it - a user may have made a fresh install of Koha after DB rev 071. Signed-off-by: Galen Charlton Signed-off-by: Joshua Ferraro --- admin/systempreferences.pl | 1 - installer/data/mysql/en/mandatory/sysprefs.sql | 1 - .../1-Obligatoire/unimarc_standard_systemprefs.sql | 1 - installer/data/mysql/updatedatabase.pl | 11 +++++++++-- kohaversion.pl | 2 +- serials/serials-edit.pl | 2 +- 6 files changed, 11 insertions(+), 7 deletions(-) diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl index 1d6574cd45..670a55cc5a 100755 --- a/admin/systempreferences.pl +++ b/admin/systempreferences.pl @@ -69,7 +69,6 @@ my %tabsysprefs; $tabsysprefs{gist}="Acquisitions"; $tabsysprefs{emailPurchaseSuggestions}="Acquisitions"; $tabsysprefs{RenewSerialAddsSuggestion}="Acquisitions"; - $tabsysprefs{serialsadditems}="Acquisitions"; # Admin $tabsysprefs{singleBranchMode}="Admin"; diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index d5753c162e..f9139a93fb 100755 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -86,7 +86,6 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ReturnBeforeExpiry',0,'If ON, checkout will be prevented if returndate is after patron card expiry',NULL,'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ReturnLog',1,'If ON, enables the circulation (returns) log',NULL,'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('reviewson',1,'If ON, enables patron reviews of bibliographic records in the OPAC','','YesNo'); -INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('serialsadditems',1,'If ON, globally enables an item record for every checked-in issue of a serial',NULL,'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('sortbynonfiling',0,'Sort search results by MARC nonfiling characters (deprecated)',NULL,'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SpecifyDueDate',1,'Define whether to display \"Specify Due Date\" form in Circulation','','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SubscriptionHistory',';','Define the display preference for serials issue history in OPAC','simplified|full','Choice'); diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql index 20ec7723e4..a059cf2788 100755 --- a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql @@ -105,7 +105,6 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ReturnBeforeExpiry', '0', 'Si ce paramètre est positionné, la date de retour d''un document ne peut pas dépasser la date de fin d''inscription d''un lecteur.', '', 'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ReturnLog', '0', 'Activer ce paramètre pour enregistrer les actions sur la circulation (les retours)', '', 'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('reviewson', '1', 'Active ou non les commentaires sur notice à l''OPAC', '', 'YesNo'); -INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('serialsadditems', '1', 'Permet de créer automatiquement un exemplaire d''un document lorsque l''on bulletine', '', 'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SessionStorage', 'mysql', 'Utiliser mySQL ou un fichier temporaire pour stocker les informations de session. mySQL pose problème dans certains cas en France. Si vous avez des problèmes de perte d''identifiant, choisissez tmp', 'mysql|tmp', 'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SubscriptionHistory', 'simplified', 'Ce paramètre définit la vue par défaut de l''état de collection, pour les abonnements. Habituellement, c''est "simplified". Choisissez "full" pour avoir l''état de collection complet par défaut', 'simplified|full', 'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SubscriptionLog', '0', 'Activer ce paramètre pour enregistrer les actions sur le bulletinage', '', 'YesNo'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 9ea474ecd8..3839a44a7b 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -1875,7 +1875,7 @@ $DBversion = '3.00.00.101'; if ( C4::Context->preference('Version') < TransformToNum($DBversion) ) { $dbh->do('ALTER TABLE `overduerules` CHANGE `categorycode` `categorycode` VARCHAR(10) NOT NULL'); $dbh->do('ALTER TABLE `deletedborrowers` CHANGE `categorycode` `categorycode` VARCHAR(10) NOT NULL'); - print "Upgrade to $DBversion done (Updating columnd definitions for patron category codes in notice/statsu triggers and deletedborrowers tables.\n"; + print "Upgrade to $DBversion done (Updating columnd definitions for patron category codes in notice/statsu triggers and deletedborrowers tables.)\n"; SetVersion($DBversion); } @@ -1885,10 +1885,17 @@ if ( C4::Context->preference('Version') < TransformToNum($DBversion) ) { $dbh->do('ALTER TABLE serialitems DROP KEY serialididx' ); $dbh->do('ALTER TABLE serialitems ADD CONSTRAINT UNIQUE KEY serialitemsidx (itemnumber)' ); $dbh->do('ALTER TABLE serialitems ADD CONSTRAINT serialitems_sfk_1 FOREIGN KEY (serialid) REFERENCES serial (serialid) ON DELETE CASCADE ON UPDATE CASCADE' ); - print "Upgrade to $DBversion done (Updating serialitems table to allow for mulitple items per serial fixing kohabug 2380\n"; + print "Upgrade to $DBversion done (Updating serialitems table to allow for mulitple items per serial fixing kohabug 2380)\n"; SetVersion($DBversion); } +$DBversion = "3.00.00.103"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("DELETE FROM systempreferences WHERE variable='serialsadditems'"); + print "Upgrade to $DBversion done ( Verifying the removal of serialsadditems from syspref fixing kohabug 2219)\n"; + SetVersion ($DBversion); +} + =item DropAllForeignKeys($table) Drop all foreign keys of the table $table diff --git a/kohaversion.pl b/kohaversion.pl index ecaa007730..0bacb7b096 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -10,7 +10,7 @@ use strict; sub kohaversion { - our $VERSION = '3.00.00.102'; + our $VERSION = '3.00.00.103'; # version needs to be set this way # so that it can be picked up by Makefile.PL # during install diff --git a/serials/serials-edit.pl b/serials/serials-edit.pl index 23eebc96e5..d54912e495 100755 --- a/serials/serials-edit.pl +++ b/serials/serials-edit.pl @@ -270,7 +270,7 @@ if ($op eq 'serialchangestatus') { } $template->param( - serialsadditems => C4::Context->preference("serialsadditems"), + serialsadditems => $serialdatalist[0]->{'serialsadditems'}, bibliotitle => $bibdata->{'title'}, biblionumber => $serialdatalist[0]->{'biblionumber'}, serialslist => \@serialdatalist, -- 2.39.5