Bug 29144: Copy and remove branches.opac_info (dbrev)
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Thu, 4 Aug 2022 09:33:13 +0000 (09:33 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 16 Sep 2022 12:55:20 +0000 (09:55 -0300)
Test plan:
Run dbrev.
Check api URL: /api/v1/public/libraries (with/without suffix /[branch_code].

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
api/v1/swagger/definitions/library.yaml
api/v1/swagger/paths/libraries.yaml
installer/data/mysql/atomicupdate/bug_29144.pl [new file with mode: 0755]
installer/data/mysql/kohastructure.sql

index c3a4daa..de010c5 100644 (file)
@@ -89,11 +89,6 @@ properties:
       - string
       - "null"
     description: notes related to your library or branch
-  opac_info:
-    type:
-      - string
-      - "null"
-    description: HTML that displays in OPAC
   geolocation:
     type:
       - string
index b2bd863..045f884 100644 (file)
         description: Case insensitive 'starts_with' search on notes
         required: false
         type: string
-      - name: opac_info
-        in: query
-        description: Case insensitive 'starts-with' search on OPAC info
-        required: false
-        type: string
       - $ref: "../swagger.yaml#/parameters/match"
       - $ref: "../swagger.yaml#/parameters/order_by"
       - $ref: "../swagger.yaml#/parameters/page"
diff --git a/installer/data/mysql/atomicupdate/bug_29144.pl b/installer/data/mysql/atomicupdate/bug_29144.pl
new file mode 100755 (executable)
index 0000000..8d9ff10
--- /dev/null
@@ -0,0 +1,19 @@
+use Modern::Perl;
+
+return {
+    bug_number => 29144,
+    description => "Copy and remove branches.opac_info",
+    up => sub {
+        my ($args) = @_;
+        my ($dbh, $out) = @$args{qw(dbh out)};
+        $dbh->do(q{
+INSERT IGNORE INTO additional_contents ( category,code,location,branchcode,title,content,lang,published_on )
+SELECT 'html_customizations', CONCAT('OpacLibraryInfo_', branches.branchcode), 'OpacLibraryInfo', branches.branchcode, branches.branchname, branches.opac_info, 'default', NOW()
+FROM branches
+WHERE branches.opac_info IS NOT NULL
+        });
+        $dbh->do(q{
+ALTER TABLE branches DROP COLUMN opac_info;
+        });
+    },
+};
index 68f9844..f105561 100644 (file)
@@ -1531,7 +1531,6 @@ CREATE TABLE `branches` (
   `issuing` tinyint(4) DEFAULT NULL COMMENT 'unused in Koha',
   `branchip` varchar(15) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'the IP address for your library or branch',
   `branchnotes` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'notes related to your library or branch',
-  `opac_info` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'HTML that displays in OPAC',
   `geolocation` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'geolocation of your library',
   `marcorgcode` varchar(16) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'MARC Organization Code, see http://www.loc.gov/marc/organizations/orgshome.html, when empty defaults to syspref MARCOrgCode',
   `pickup_location` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'the ability to act as a pickup location',