Bugzilla – Attachment 79949 Details for
Bug 21487
Add option to disable CataloguingLog syspref in UNIMARC_sync_date_created_with_marc_biblio.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21487: Disable CataloguingLog syspref in UNIMARC_sync_date_created_with_marc_biblio.pl
Bug-21487-Disable-CataloguingLog-syspref-in-UNIMAR.patch (text/plain), 2.26 KB, created by
Fridolin Somers
on 2018-10-04 14:02:43 UTC
(
hide
)
Description:
Bug 21487: Disable CataloguingLog syspref in UNIMARC_sync_date_created_with_marc_biblio.pl
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2018-10-04 14:02:43 UTC
Size:
2.26 KB
patch
obsolete
>From a181679ed8f33641a7f78ec673a3861e9e84108d Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Thu, 4 Oct 2018 15:39:27 +0200 >Subject: [PATCH] Bug 21487: Disable CataloguingLog syspref in > UNIMARC_sync_date_created_with_marc_biblio.pl > >Script UNIMARC_sync_date_created_with_marc_biblio.pl edits MARC record to define 099 $c and $d. >This should not be registered as a cataloguing change in action_logs table. >So script must disable CataloguingLog syspref (if enabled) during its process. > >Test plan : >1) Don't apply the patch yet >2) Have the CataloguingLog system preference set to 'Log' >3) Create a new record >4) Count entries in action_logs table >5) Run : UNIMARC_sync_date_created_with_marc_biblio.pl --run -v >6) Check the CataloguingLog system preference is still 'Log' >7) Count entries in action_logs table => there are more >8) Apply the patch >9) Repeate from 3) to 6) >10) Count entries in action_logs table => there are the same >--- > .../UNIMARC_sync_date_created_with_marc_biblio.pl | 11 +++++++++++ > 1 file changed, 11 insertions(+) > >diff --git a/misc/maintenance/UNIMARC_sync_date_created_with_marc_biblio.pl b/misc/maintenance/UNIMARC_sync_date_created_with_marc_biblio.pl >index a46dc7b0f4..ec6076096e 100755 >--- a/misc/maintenance/UNIMARC_sync_date_created_with_marc_biblio.pl >+++ b/misc/maintenance/UNIMARC_sync_date_created_with_marc_biblio.pl >@@ -12,6 +12,7 @@ BEGIN { > eval { require "$FindBin::Bin/../kohalib.pl" }; > } > >+use C4::Context; > use C4::Biblio; > use Getopt::Long; > >@@ -207,6 +208,13 @@ sub process { > $dbh = C4::Context->dbh; > my $mod_count = 0; > >+ # Disable the syspref cache so we can change logging settings >+ C4::Context->disable_syspref_cache(); >+ # Save current CataloguingLog syspref value >+ my $CataloguingLog = C4::Context->preference('CataloguingLog'); >+ # Disable logging >+ C4::Context->set_preference( 'CataloguingLog', 0 ); >+ > my $query = q{ > SELECT biblionumber > FROM biblio >@@ -229,6 +237,9 @@ sub process { > } > > $verbose and print "Number of modified biblios: " . $mod_count . "\n"; >+ >+ # Restore CataloguingLog >+ C4::Context->set_preference( 'CataloguingLog', $CataloguingLog ); > } > > if ( lc( C4::Context->preference('marcflavour') ) eq "unimarc" ) { >-- >2.17.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 21487
:
79949
|
80156
|
80241