From 822f6094a31ad797ddb055742d6651aa39e26cb2 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Sun, 22 Dec 2019 13:07:46 +0000 Subject: [PATCH] Bug 24206: Update content of OpacSearchForTitleIn for existing installations This includes a database update for existing installations. Using the REPLACE function it makes the same changes to the URLs as the previous patch did for new installations: - Worldcat: now https - BookFinder: now https - OpenLibrary: remove / before search parameters To test: - Verify the current content of your preference OpacSearchForTitleIn (without changes from first patch!) - Run the database update - Verify everything still works, but changes have been made Signed-off-by: David Nind Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize Signed-off-by: Joy Nelson (cherry picked from commit 8efad71adbd7fa9afc8bd6c204a91d193e3e308c) Signed-off-by: Lucas Gass --- .../atomicupdate/bug_24206_update_searchfortitlein.perl | 9 +++++++++ installer/data/mysql/sysprefs.sql | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/bug_24206_update_searchfortitlein.perl diff --git a/installer/data/mysql/atomicupdate/bug_24206_update_searchfortitlein.perl b/installer/data/mysql/atomicupdate/bug_24206_update_searchfortitlein.perl new file mode 100644 index 0000000000..46c26c2d49 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_24206_update_searchfortitlein.perl @@ -0,0 +1,9 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + $dbh->do( 'UPDATE systempreferences SET value = REPLACE(value, "http://worldcat.org", "https://worldcat.org") WHERE variable = "OPACSearchForTitleIn"' ); + $dbh->do( 'UPDATE systempreferences SET value = REPLACE(value, "http://www.bookfinder.com", "https://www.bookfinder.com") WHERE variable = "OPACSearchForTitleIn"' ); + $dbh->do( 'UPDATE systempreferences SET value = REPLACE(value, "https://openlibrary.org/search/?", "https://openlibrary.org/search?") WHERE variable = "OPACSearchForTitleIn"' ); + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug XXXXX - Update OpacSearchForTitleIn system preference)\n"; +} diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index b41c8e2f75..c4d5d2b1ab 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -411,7 +411,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('OpacResetPassword','0','','Shows the ''Forgot your password?'' link in the OPAC','YesNo'), ('OPACResultsLibrary', 'homebranch', 'homebranch|holdingbranch', 'Defines whether the OPAC displays the holding or home branch in search results when using XSLT', 'Choice'), ('OPACResultsSidebar','','70|10','Define HTML to be included on the search results page, underneath the facets sidebar','Textarea'), -('OPACSearchForTitleIn','
  • Other Libraries (WorldCat)
  • \n
  • Other Databases (Google Scholar)
  • \n
  • Online Stores (Bookfinder.com)
  • \n
  • Open Library (openlibrary.org)
  • ','70|10','Enter the HTML that will appear in the \'Search for this title in\' box on the detail page in the OPAC. Enter {TITLE}, {AUTHOR}, or {ISBN} in place of their respective variables in the URL. Leave blank to disable \'More Searches\' menu.','Textarea'), +('OPACSearchForTitleIn','
  • Other Libraries (WorldCat)
  • \n
  • Other Databases (Google Scholar)
  • \n
  • Online Stores (Bookfinder.com)
  • \n
  • Open Library (openlibrary.org)
  • ','70|10','Enter the HTML that will appear in the \'Search for this title in\' box on the detail page in the OPAC. Enter {TITLE}, {AUTHOR}, or {ISBN} in place of their respective variables in the URL. Leave blank to disable \'More Searches\' menu.','Textarea'), ('OpacSeparateHoldings','0',NULL,'Separate current branch holdings from other holdings (OPAC)','YesNo'), ('OpacSeparateHoldingsBranch','homebranch','homebranch|holdingbranch','Branch used to separate holdings (OPAC)','Choice'), ('opacSerialDefaultTab','subscriptions','holdings|serialcollection|subscriptions','Define the default tab for serials in OPAC.','Choice'), -- 2.39.5