From 5ea5938fb25434ae090cf44434b35e8a4a283653 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Tue, 4 Sep 2012 15:02:51 -0300 Subject: [PATCH] Bug 8724 - Upgrade from NoZebra installs is broken MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" Properly set the relevant NoZebra and QueryRemoveStopwords sysprefs to 0 to fix issues on upgrades. Also removes the sysprefs from preferences/searching.pref Regards To+ Sponsored-by: Universidad Nacional de Córdoba Signed-off-by: Kyle M Hall --- installer/data/mysql/sysprefs.sql | 2 +- installer/data/mysql/updatedatabase.pl | 8 ++++++++ .../en/modules/admin/preferences/searching.pref | 19 ------------------- 3 files changed, 9 insertions(+), 20 deletions(-) diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 35f92cc..c793898 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -115,7 +115,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('z3950NormalizeAuthor',0,'If ON, Personal Name Authorities will replace authors in biblio.author','','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ReservesNeedReturns',1,'If ON, a hold placed on an item available in this library must be checked-in, otherwise, a hold on a specific item, that is in the library & available is considered available','','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('DebugLevel',2,'Define the level of debugging information sent to the browser when errors are encountered (set to 0 in production). 0=none, 1=some, 2=most','0|1|2','Choice'); -INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('NoZebra',1,'If ON, Zebra indexing is turned off, simpler setup, but slower searches. WARNING: using NoZebra on even modest sized collections is very slow.','','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('NoZebra',0,'If ON, Zebra indexing is turned off, simpler setup, but slower searches. WARNING: using NoZebra on even modest sized collections is very slow.','','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('SessionStorage','mysql','Use database or a temporary file for storing session data','mysql|Pg|tmp','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('CircAutocompl',1,'If ON, autocompletion is enabled for the Circulation input',NULL,'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('RoutingSerials',1,'If ON, serials routing is enabled',NULL,'YesNo'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 25cd367..a0dae02 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -5696,6 +5696,14 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion($DBversion); } +$DBversion = 'XXX'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("UPDATE systempreferences SET value=0 WHERE variable='NoZebra'"); + $dbh->do("UPDATE systempreferences SET value=0 WHERE variable='QueryRemoveStopwords'"); + print "Upgrade to $DBversion done (Disable obsolete NoZebra and QueryRemoveStopwords sysprefs)\n"; + SetVersion ($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref index 5176d52..2d90a83 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref @@ -1,18 +1,6 @@ Searching: Features: - - - pref: NoZebra - choices: - yes: "Don't use" - no: Use - - the Zebra search engine. It is recommended to use Zebra; the option to not use Zebra is deprecated and is not guaranteed to work. - - - - When Zebra is not in use, translate the following MARC fields to the following indexes (each line should look something like 'indexname' => '100a,245a,500*',) - - pref: NoZebraIndexes - type: textarea - class: list - - - - - Perform wildcard searching (where, for example, Har would match Harry and harp) - pref: QueryAutoTruncate type: boolean @@ -28,13 +16,6 @@ Searching: no: "Don't try" - to match similarly spelled words in a search (for example, a search for flang would also match flange and fang; REQUIRES ZEBRA). - - - pref: QueryRemoveStopwords - type: boolean - choices: - yes: Ignore - no: "Don't ignore" - - stopwords specified in Koha when searching. (Only applies when Zebra is off). - - - pref: QueryStemming type: boolean choices: -- 1.7.2.5