Bug 8844 - UNIMARC_sync_date_created_with_marc_biblio.pl creates a modification log
Summary: UNIMARC_sync_date_created_with_marc_biblio.pl creates a modification log
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: 3.10
Hardware: All All
: P5 - low normal (vote)
Assignee: Fridolin Somers
QA Contact: Paul Poulain
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-28 16:41 UTC by Fridolin Somers
Modified: 2014-05-26 21:04 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Proposed patch (8.96 KB, patch)
2012-09-28 16:48 UTC, Fridolin Somers
Details | Diff | Splinter Review
Proposed patch (revised) (8.84 KB, patch)
2012-10-24 09:00 UTC, Fridolin Somers
Details | Diff | Splinter Review
Proposed patch (revised) (8.92 KB, patch)
2012-11-09 08:29 UTC, Mathieu Saby
Details | Diff | Splinter Review
Bug 8844: UNIMARC_sync_date_created_with_marc_biblio.pl creates a modification log (8.96 KB, patch)
2012-11-20 11:16 UTC, Paul Poulain
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin Somers 2012-09-28 16:41:38 UTC
When using UNIMARC_sync_date_created_with_marc_biblio.pl script with CataloguingLog on, you get a modification log on all catalog.

Script should not call ModBiblio() when dates are already synchronized.
Comment 1 Fridolin Somers 2012-09-28 16:48:17 UTC Comment hidden (obsolete)
Comment 2 Fridolin Somers 2012-09-28 17:03:06 UTC
Script now does not call ModBiblio() when dates are already synchronized.

And many more :

+ help usage with -h

+ verbose option to print several infos (count biblios, which biblio has been modified, ...)

+ manages DEBUG env var to print even more

+ 'where' option to limit process to some biblios (usefull to test and to run incremental modifications)

+ 099$c and 099$d are default values but you can specify what fields you use for 
date created and date last modified (works with control fields < 010)

+ test mode : if 'run' option is missing, script still shows which biblio would have been modified
Comment 3 Fridolin Somers 2012-10-24 09:00:16 UTC Comment hidden (obsolete)
Comment 4 Mathieu Saby 2012-10-29 13:52:57 UTC
I made some tests with a standard and non-standard unimarc configuration. It is working properly (the right fields and subfields are edited in the records).

Ex for a non-standard configuration: 
UNIMARC_sync_date_created_with_marc_biblio.pl -v -run -c 099b -m 099c

I also tested the where option. It is working too (if the SQL limitation contains several words, you need to put into " ")
Ex : 
UNIMARC_sync_date_created_with_marc_biblio.pl -v --where "biblionumber between 1 and 4"
=>
"Number of concerned biblios: 4"


So I sign off.

Mathieu Saby
Rennes 2 University
Comment 5 Mason James 2012-11-09 04:56:15 UTC
(In reply to comment #4)
> 
> So I sign off.
> 
> Mathieu Saby
> Rennes 2 University

Mathieu, will you please add you sign-off to the patch?


i might have to pass on this QA, i no not have a UNIMARC koha configured

Marcel, could you QA this one?
Comment 6 Mathieu Saby 2012-11-09 08:29:22 UTC Comment hidden (obsolete)
Comment 7 Paul Poulain 2012-11-09 09:20:51 UTC
(In reply to comment #6)
> Created attachment 13339 [details] [review]
> Proposed patch (revised)
> 
> Is it ok for you ? (This is my first sign off in BZ...)
Yes, the signoff is OK

(and, to answer here the PM you sent me = you should really use git-bz, it's a wonderful tool. Really !)
Comment 8 Paul Poulain 2012-11-20 11:15:46 UTC
QA comment:
 * no string changes
 * passes koha-qa.pl (the script reports 	forbidden patterns          FAIL
		The patch introduces a forbidden pattern: merge marker (=======) (49)
that is wrong, the ==== are included in a warn, and perfectly valid. Will report the problem to QA team
 * UNIMARC only script & maintainance only script, no side effect risk

passed QA
Comment 9 Paul Poulain 2012-11-20 11:16:07 UTC
Created attachment 13548 [details] [review]
Bug 8844: UNIMARC_sync_date_created_with_marc_biblio.pl creates a modification log

Signed-off by : Mathieu Saby <mathieu.saby@univ-rennes2.fr>

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Comment 10 Jared Camins-Esakov 2012-11-20 19:33:08 UTC
This patch has been pushed to master. I did not test it personally because I did not have an explanation of what the script does. Since it is a UNIMARC-only script that has been tested by several UNIMARC users, I decided to push it anyway so that it was available for inclusion in 3.10, per Paul's request.
Comment 11 Fridolin Somers 2012-11-21 08:27:53 UTC
(In reply to comment #8)
>  * passes koha-qa.pl (the script reports 	forbidden patterns          FAIL
> 		The patch introduces a forbidden pattern: merge marker (=======) (49)
I will remember this point for future patches.
I agree that merge markers should be avoided, even in a warn.
Comment 12 Fridolin Somers 2012-11-21 08:34:17 UTC
(In reply to comment #10)
> This patch has been pushed to master. I did not test it personally because I
> did not have an explanation of what the script does. Since it is a
> UNIMARC-only script that has been tested by several UNIMARC users, I decided
> to push it anyway so that it was available for inclusion in 3.10, per Paul's
> request.

Thanks Jared.

The purpose of this script in a few words : 
When creating/saving a biblio, fields datecreated and timestamp will be completed by database engine with current date/timestamp. In UNIMARC, we want MARC datas 090$c and 090$d to be synchronized with biblio.datecreated and biblio.timestamp. But this synchronization does only exist form MARC to database. This script synchronizes database to MARC for biblio.datecreated and biblio.timestamp. It is usually configured in a daily cron.
Comment 13 Paul Poulain 2012-11-22 15:39:38 UTC
Patch pushed to branch 3.10.x