Bugzilla – Attachment 179341 Details for
Bug 38330
Make bib-level suppression a biblio table field instead of part of a marc tag
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38330: (QA follow-up) Add population of opac_suppressed from biblio_metadata
Bug-38330-QA-follow-up-Add-population-of-opacsuppr.patch (text/plain), 3.06 KB, created by
Martin Renvoize (ashimema)
on 2025-03-14 16:31:32 UTC
(
hide
)
Description:
Bug 38330: (QA follow-up) Add population of opac_suppressed from biblio_metadata
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-03-14 16:31:32 UTC
Size:
3.06 KB
patch
obsolete
>From d86893da5e5b2af70663041b9e232956eff43ae7 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 14 Mar 2025 16:28:26 +0000 >Subject: [PATCH] Bug 38330: (QA follow-up) Add population of opac_suppressed > from biblio_metadata > >This patch updates the database update to populate the new >opac_suppressed field in the bilios table using the data in the >biblio_metadata table. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../data/mysql/atomicupdate/bug_38330.pl | 31 +++++++++++++++++++ > 1 file changed, 31 insertions(+) > >diff --git a/installer/data/mysql/atomicupdate/bug_38330.pl b/installer/data/mysql/atomicupdate/bug_38330.pl >index b5f006b42f3..9e04f141b28 100755 >--- a/installer/data/mysql/atomicupdate/bug_38330.pl >+++ b/installer/data/mysql/atomicupdate/bug_38330.pl >@@ -15,6 +15,21 @@ return { > ADD COLUMN `opac_suppressed` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'whether the record should be suppressed in the OPAC' AFTER `abstract`; > } > ); >+ >+ $dbh->do( >+ q{ >+ UPDATE biblio b >+ JOIN biblio_metadata m ON b.biblionumber = m.biblionumber >+ SET b.opac_suppressed = >+ CASE >+ WHEN ExtractValue(m.metadata, '//datafield[@tag="952"]/subfield[@code="n"]') REGEXP '^[01]$' THEN >+ ExtractValue(m.metadata, '//datafield[@tag="952"]/subfield[@code="n"]') >+ ELSE 0 >+ END >+ WHERE m.metadata LIKE '%<datafield tag="952">%'; >+ } >+ ); >+ > say $out "Added column 'biblio.opac_suppressed'"; > } > >@@ -25,6 +40,21 @@ return { > ADD COLUMN `opac_suppressed` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'whether the record should be suppressed in the OPAC' AFTER `abstract`; > } > ); >+ >+ $dbh->do( >+ q{ >+ UPDATE deletedbiblio b >+ JOIN deletedbiblio_metadata m ON b.biblionumber = m.biblionumber >+ SET b.opac_suppressed = >+ CASE >+ WHEN ExtractValue(m.metadata, '//datafield[@tag="952"]/subfield[@code="n"]') REGEXP '^[01]$' THEN >+ ExtractValue(m.metadata, '//datafield[@tag="952"]/subfield[@code="n"]') >+ ELSE 0 >+ END >+ WHERE m.metadata LIKE '%<datafield tag="952">%'; >+ } >+ ); >+ > say $out "Added column 'deletedbiblio.opac_suppressed'"; > } > >@@ -33,6 +63,7 @@ return { > UPDATE marc_subfield_structure SET kohafield='biblio.opac_suppressed' WHERE tagfield=942 AND tagsubfield='n'; > } > ); >+ > say $out "Set the 942\$n => biblio.opac_suppressed mapping for all MARC frameworks"; > say_warning( $out, "You need to run the `maintenance/touch_all_biblios.pl` script" ); > }, >-- >2.48.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 38330
:
175648
|
175649
|
175650
|
175651
|
175767
|
175768
|
175769
|
175770
|
179335
|
179336
|
179337
|
179338
|
179339
|
179340
| 179341