This is an enhancement Created attachment 64808 [details] [review] Bug 13560 - need an add option in marc modification templates Add/Update would update a field or create new if it existed, but didn't allow for creating new if the field existed. This patchset splits the options to Add & Update so that add will always add a field and Update will operate as it always has To test: 1 - Have a record with a known existing field (make a copy) 2 - Define a marc modification template that 'Add/update' on that field 3 - Define an 'Add/Update' on a field that doesn't exist 4 - Batch modify the copy of record using the above template 5 - Verify the existing field was updated 6 - Verify the non-existing field was updated 7 - Apply patch 8 - Make another copy 9 - Modify the copy with the same template as above 10 - Should match initial modification 11 - Add a new rule to add a new field 12 - Modify using the updated template 13 - Ensure your new field is created 14 - Test various options in the modification tool 15 - prove t/db_dependent/MarcModificationTemplates.t when i use the tool (step 12) i have this message Software error: Template process failed: undef error - The method itemnumbers is not covered by tests! at /home/koha/src/C4/Templates.pm line 121. And when i want add the rule 'Add' in the template(step11) , koha fix the rule delete I think Update is not quite right as the option actually adds a field when it doesn't exist yet. I have used it to add items with different subfields a lot of times. Maybe it needs a better description - Add or update? Created attachment 68540 [details] [review] Bug 13560 - need an add option in marc modification templates Add/Update would update a field or create new if it existed, but didn't allow for creating new if the field existed. This patchset splits the options to Add & Update so that add will always add a field and Update will operate as it always has To test: 1 - Have a record with a known existing field (make a copy) 2 - Define a marc modification template that 'Add/update' on that field 3 - Define an 'Add/Update' on a field that doesn't exist 4 - Batch modify the copy of record using the above template 5 - Verify the existing field was updated 6 - Verify the non-existing field was updated 7 - Apply patch 8 - Make another copy 9 - Modify the copy with the same template as above 10 - Should match initial modification 11 - Add a new rule to add a new field 12 - Modify using the updated template 13 - Ensure your new field is created 14 - Test various options in the modification tool 15 - prove t/db_dependent/MarcModificationTemplates.t When I try to do step 11 in the test plan, the rule created comes out as "Delete" rather than "Add new". Similarly, if I try to edit the rule to make it "Add new" it goes back to "Delete" once the "Update action" button is pressed in the "Edit action 3" dialog box. Conflict when applying the patch.
In t/db_dependent/MarcModificationTemplates.t
<<<<<<< ff82c9aadc441f9ca18dcad2e58783e733cdd839 (from November 3 on master)
use Test::More tests => 96;
||||||| merged common ancestors
use Test::More tests => 95;
=======
use Test::More tests => 114;
>>>>>>> Bug 13560 - need an add option in marc modification templates
(this patch's version)
Does anyone know which value should be elected between the conflicting commits? (or maybe if another one should) Created attachment 70562 [details] [review] Bug 13560 - Database changes Created attachment 70563 [details] [review] Bug 13560 - Unit tests To test: 1 - apply all patches 2 - update database 3 - prove t/db_dependent/MarcModificationTemplates.t Created attachment 70564 [details] [review] Bug 13560: Add an 'Add' option for marc modification templates Add/Update would update a field or create new if it existed, but didn't allow for creating new if the field existed. This patchset splits the options to 'Add & Update' so that 'Add' will always add a field and 'Update' will operate as it always has To test: 1 - Have a record with a known existing field (make a copy) 2 - Define a marc modification template that 'Add/update' on that field 3 - Define an 'Add/Update' on a field that doesn't exist 4 - Batch modify the copy of record using the above template 5 - Verify the existing field was updated 6 - Verify the non-existing field was updated 7 - Apply patch and update database 8 - Make another copy 9 - Modify the copy with the same template as above 10 - Should match initial modification 11 - Add a new rule to add a new field 12 - Modify using the updated template 13 - Ensure your new field is created 14 - Test various options in the modification tool 15 - prove t/db_dependent/MarcModificationTemplates.t fixed the conflict, split the patches, added DB update to instructions Created attachment 70613 [details] [review] Bug 13560: Add an 'Add' option for marc modification templates Add/Update would update a field or create new if it existed, but didn't allow for creating new if the field existed. This patchset splits the options to 'Add & Update' so that 'Add' will always add a field and 'Update' will operate as it always has To test: 1 - Have a record with a known existing field (make a copy) 2 - Define a marc modification template that 'Add/update' on that field 3 - Define an 'Add/Update' on a field that doesn't exist 4 - Batch modify the copy of record using the above template 5 - Verify the existing field was updated 6 - Verify the non-existing field was updated 7 - Apply patch and update database 8 - Make another copy 9 - Modify the copy with the same template as above 10 - Should match initial modification 11 - Add a new rule to add a new field 12 - Modify using the updated template 13 - Ensure your new field is created 14 - Test various options in the modification tool 15 - prove t/db_dependent/MarcModificationTemplates.t Signed-off-by: Victor Grousset <victor.grousset@biblibre.com> As for step «14 - Test various options in the modification tool» I only moved one field to another to ensure that the target is overwritten without error. Is that enough? Created attachment 71115 [details] [review] Bug 13560 - Database changes Signed-off-by: Victor Grousset <victor.grousset@biblibre.com> Created attachment 71116 [details] [review] Bug 13560 - Unit tests To test: 1 - apply all patches 2 - update database 3 - prove t/db_dependent/MarcModificationTemplates.t Signed-off-by: Victor Grousset <victor.grousset@biblibre.com> Created attachment 71117 [details] [review] Bug 13560: Add an 'Add' option for marc modification templates Add/Update would update a field or create new if it existed, but didn't allow for creating new if the field existed. This patchset splits the options to 'Add & Update' so that 'Add' will always add a field and 'Update' will operate as it always has To test: 1 - Have a record with a known existing field (make a copy) 2 - Define a marc modification template that 'Add/update' on that field 3 - Define an 'Add/Update' on a field that doesn't exist 4 - Batch modify the copy of record using the above template 5 - Verify the existing field was updated 6 - Verify the non-existing field was updated 7 - Apply patch and update database 8 - Make another copy 9 - Modify the copy with the same template as above 10 - Should match initial modification 11 - Add a new rule to add a new field 12 - Modify using the updated template 13 - Ensure your new field is created 14 - Test various options in the modification tool 15 - prove t/db_dependent/MarcModificationTemplates.t Signed-off-by: Victor Grousset <victor.grousset@biblibre.com> I forgot to sign off the first two patches. So here they are. To no loose my previous comment: As for step «14 - Test various options in the modification tool» I only moved one field to another to ensure that the target is overwritten without error. Is that enough? (In reply to Nick Clemens on IRC)
> ideally you would test all the options just to ensure I didn't break anything unintentionally, but if any other option worked it would seem features are intact
I tried to play with the copy function, but that failed (even on the 17.11) so due to lack of functional knowledge I can't improvise more than that.
But that doesn't seem a big issue. So this would be reading for being QAed if I understand correctly.
Created attachment 75584 [details] [review] Bug 13560 - Database changes Signed-off-by: Victor Grousset <victor.grousset@biblibre.com> Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Created attachment 75585 [details] [review] Bug 13560 - Unit tests To test: 1 - apply all patches 2 - update database 3 - prove t/db_dependent/MarcModificationTemplates.t Signed-off-by: Victor Grousset <victor.grousset@biblibre.com> Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Created attachment 75586 [details] [review] Bug 13560: Add an 'Add' option for marc modification templates Add/Update would update a field or create new if it existed, but didn't allow for creating new if the field existed. This patchset splits the options to 'Add & Update' so that 'Add' will always add a field and 'Update' will operate as it always has To test: 1 - Have a record with a known existing field (make a copy) 2 - Define a marc modification template that 'Add/update' on that field 3 - Define an 'Add/Update' on a field that doesn't exist 4 - Batch modify the copy of record using the above template 5 - Verify the existing field was updated 6 - Verify the non-existing field was updated 7 - Apply patch and update database 8 - Make another copy 9 - Modify the copy with the same template as above 10 - Should match initial modification 11 - Add a new rule to add a new field 12 - Modify using the updated template 13 - Ensure your new field is created 14 - Test various options in the modification tool 15 - prove t/db_dependent/MarcModificationTemplates.t Signed-off-by: Victor Grousset <victor.grousset@biblibre.com> Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Awesome work all! Pushed to master for 18.11 Enhancement, will not be backported to 18.05.x series. |
Created attachment 35108 [details] add/update on marc mod is only updating Right now the marc modification templates have an add/update option but it's only updating. So let's say I want to add a new 650 (like attached) it's updating all existing 650s to have the value I want to add as a new 650.