Bug 5354

Summary: Partial duplication of a subscription
Product: Koha Reporter: Paul Poulain <paul.poulain>
Component: SerialsAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: enhancement    
Priority: P5 - low CC: jonathan.druart, kristina, laurence.rault, m.de.rooy
Version: 3.8   
Hardware: All   
OS: All   
URL: http://wiki.koha-community.org/wiki/Partial_duplicating_serials_RFC
Change sponsored?: Sponsored Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Deadline: 2011-05-01   
Attachments: Bug 5354: Partial duplication of a subscription
Bug 5354: Partial duplication of a subscription
Bug 5354 Partial duplication of a subscription
Bug 5354 Partial duplication of a subscription
[SIGNED-OFF] Bug 5354 Partial duplication of a subscription
Bug 5354 Followup Change separator
Bug 5354 Followup Change separator

Description Paul Poulain 2010-11-02 03:43:06 UTC
A syspref will be added that contains the list of fields to duplicate when duplicating a subscription. The library will be able to define that, for example, the internal note should not be duplicated
Comment 1 Jonathan Druart 2012-03-08 10:04:38 UTC Comment hidden (obsolete)
Comment 2 Kristina Hoeppner 2012-03-19 07:41:27 UTC
I tested this patch on the BibLibre sandbox http://pro.test8.biblibre.com/cgi-bin/koha/sandbox.pl

and received the following conflict message:

<h1>Something went wrong !</h1>Applying: Bug 5354: Partial duplication of a subscription<br/>
Using index info to reconstruct a base tree...<br/>
Falling back to patching base and 3-way merge...<br/>
Auto-merging installer/data/mysql/updatedatabase.pl<br/>
CONFLICT (content): Merge conflict in installer/data/mysql/updatedatabase.pl<br/>
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/serials.pref<br/>
Failed to merge in the changes.<br/>
Patch failed at 0001 Bug 5354: Partial duplication of a subscription<br/>
When you have resolved this problem run git am --resolved.<br/>
If you would prefer to skip this patch, instead run git am --skip.<br/>
To restore the original branch and stop patching run git am --abort.<br/>
Bug 5354 - Partial duplication of a subscription<br/>
Comment 3 Jonathan Druart 2012-03-19 09:23:36 UTC Comment hidden (obsolete)
Comment 4 Laurence Rault 2012-03-19 15:16:17 UTC
tested on biblibre sandbox

OK for fields : 
branchcode
notes
location
callnumber
internalnotes
periodicity
numberpattern
numberingmethod

Failed for firstacquidate;startdate;numberlength
Except if it is the expected comportment.
Comment 5 Jonathan Druart 2012-03-19 16:14:55 UTC
It's based on the 'id' in the html code.

firstacquidate is acqui_date
startdate is beginning_date
and numberlength is subtype

Perhaps I can change this id node but I don't known if to change this id does not break something
Comment 6 Laurence Rault 2012-03-20 13:32:13 UTC
not ok for subtype
Comment 7 Jonathan Druart 2012-03-20 15:16:20 UTC Comment hidden (obsolete)
Comment 8 Kristina Hoeppner 2012-03-21 09:33:38 UTC
Sorry, Jonathan. I had a merge conflict again. :-(

<h1>Something went wrong !</h1>Applying: Bug 5354: Partial duplication of a subscription<br/>
Using index info to reconstruct a base tree...<br/>
Falling back to patching base and 3-way merge...<br/>
Auto-merging installer/data/mysql/updatedatabase.pl<br/>
CONFLICT (content): Merge conflict in installer/data/mysql/updatedatabase.pl<br/>
Failed to merge in the changes.<br/>
Patch failed at 0001 Bug 5354: Partial duplication of a subscription<br/>
When you have resolved this problem run git am --resolved.<br/>
If you would prefer to skip this patch, instead run git am --skip.<br/>
To restore the original branch and stop patching run git am --abort.<br/>
Bug 5354 - Partial duplication of a subscription<br/>
<br/>
Comment 9 Jonathan Druart 2012-03-21 09:39:14 UTC Comment hidden (obsolete)
Comment 10 Kristina Hoeppner 2012-03-22 05:40:24 UTC
Created attachment 8461 [details] [review]
[SIGNED-OFF] Bug 5354 Partial duplication of a subscription

Tested the patch with the following fields (taken from the HTML code input field IDs):

branchcode
notes
location
callnumber
internalnotes
periodicity
numberpattern
numberingmethod
acqui_date
beginning_date
numberlength
aqbooksellerid
biblionumber
graceperiod
staffdisplaycount
opacdisplaycount
ending_date

For aqbooksellerid and aqbooksellerid, the old information is still visible in the greyed-out boxes, but it is not displayed when you attempt to save the record.

Left out serialsadditems-yes and serialsadditesm-no as you would always have to set this anyway.
Comment 11 Kristina Hoeppner 2012-03-22 06:43:45 UTC
I meant to write:

For aqbooksellerid and biblionumber, the old information is still visible in the greyed-out boxes, but it is not displayed when you attempt to save the record.
Comment 12 Marcel de Rooy 2012-03-23 15:29:02 UTC
QA Comment: Without testing the code itself, looks good. Externally tested by more than one individual. Few comments:

Name SubscriptionDuplicateDroppedInput confuses me, but no blocker. The description is clear though.

The pref should be added to sysprefs.sql. (I tend to forget that too.) If Paul pushes this one, could you add it, Paul?

You separate fields with semicolon. Please note that several new prefs separate with |. I do not mind, but we should go for consistency (at least try ;) No blocker, but a followup? 

Passed QA.
Comment 13 Jonathan Druart 2012-03-26 07:09:19 UTC Comment hidden (obsolete)
Comment 14 Paul Poulain 2012-03-26 14:31:37 UTC
Jonathan, for an unknown reason, when applying the follow-up, I get a:

Applying: Bug 5354: Followup. Change separator
fatal: sha1 information is lacking or useless (installer/data/mysql/updatedatabase.pl).
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 Bug 5354: Followup. Change separator
When you have resolved this problem run "git am --resolved".


anything unusual when formatting your patch ? could you resubmit the follow-up if you have an idea why this one don't work
Comment 15 Jonathan Druart 2012-03-26 15:03:27 UTC
Created attachment 8634 [details] [review]
Bug 5354 Followup Change separator

rebased patch
Comment 16 Paul Poulain 2012-03-28 14:19:13 UTC
There was a small bug introduced by the (tiny) follow-up to change the separator, as requested by marcel in comment 12.
I've fixed it when pushing
Comment 17 Jared Camins-Esakov 2012-12-31 00:49:14 UTC
There have been no further reports of problems so I am marking this bug resolved.