Bug 21487 - Disable CataloguingLog syspref in UNIMARC_sync_date_created_with_marc_biblio.pl
Summary: Disable CataloguingLog syspref in UNIMARC_sync_date_created_with_marc_biblio.pl
Status: In Discussion
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Fridolin SOMERS
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-04 13:26 UTC by Fridolin SOMERS
Modified: 2018-10-10 06:30 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 21487: Disable CataloguingLog syspref in UNIMARC_sync_date_created_with_marc_biblio.pl (2.26 KB, patch)
2018-10-04 14:02 UTC, Fridolin SOMERS
Details | Diff | Splinter Review
Bug 21487: Disable CataloguingLog syspref in UNIMARC_sync_date_created_with_marc_biblio.pl (2.31 KB, patch)
2018-10-06 07:53 UTC, David Nind
Details | Diff | Splinter Review
Bug 21487: Disable CataloguingLog syspref in UNIMARC_sync_date_created_with_marc_biblio.pl (2.36 KB, patch)
2018-10-08 21:42 UTC, Chris Cormack
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin SOMERS 2018-10-04 13:26:30 UTC
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.
Comment 1 Fridolin SOMERS 2018-10-04 13:26:57 UTC
Same has Bug 10326 for bulkmarcimport.pl
Comment 2 Fridolin SOMERS 2018-10-04 14:02:43 UTC
Created attachment 79949 [details] [review]
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
Comment 3 David Nind 2018-10-06 07:53:35 UTC
Created attachment 80156 [details] [review]
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

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 Chris Cormack 2018-10-08 21:42:14 UTC
Created attachment 80241 [details] [review]
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

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Comment 5 Nick Clemens 2018-10-09 12:15:54 UTC
This follows the same pattern as batchRebuildItemsTables, however, we have found this can cause problems if the script is disrupted or errors halfway through (DB and cache have differing values and they aren't fixed until a cache is restarted)

I would prefer to see something like bug 18816 - add a parameter to the functions that are logged to allow preventing that, rather than altering sysprefs
Comment 6 Fridolin SOMERS 2018-10-10 06:30:54 UTC
(In reply to Nick Clemens from comment #5)
> This follows the same pattern as batchRebuildItemsTables, however, we have
> found this can cause problems if the script is disrupted or errors halfway
> through (DB and cache have differing values and they aren't fixed until a
> cache is restarted)
> 
> I would prefer to see something like bug 18816 - add a parameter to the
> functions that are logged to allow preventing that, rather than altering
> sysprefs

I agree, I'll try to find time for that. Any help is welcomed.