Bug 21487 - Add option to disable CataloguingLog syspref in UNIMARC_sync_date_created_with_marc_biblio.pl
Summary: Add option to disable CataloguingLog syspref in UNIMARC_sync_date_created_wit...
Status: ASSIGNED
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Fridolin Somers
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-04 13:26 UTC by Fridolin Somers
Modified: 2024-02-07 13:45 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
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.
Comment 7 Katrin Fischer 2019-10-14 21:02:12 UTC
Changing out of discussion - I think agreement to add a parameter was reached.