Summary: | Allow to select MARC fields to merge on staged MARC import | ||
---|---|---|---|
Product: | Koha | Reporter: | Amit Gupta <amitddng135> |
Component: | Acquisitions | Assignee: | Amit Gupta <kohapatch> |
Status: | Failed QA --- | QA Contact: | |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | abl, amitddng135, colin.campbell, emjhet, gitbot, jonathan.druart, josef.moravec, katrin.fischer, nicolas.bravais, sandboxes |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Attachments: |
Increased flexibility for upload of Staged
Alter table import_batches Bug-10477 Increased flexibility for upload of Staged Alter table import_batches Bug-10477 Increased flexibility for upload of Staged Bug-10477-Alter table import_batches Bug-10477 Increased flexibility for upload of Staged Bug-10477-Alter table import_batches Bug-10477 Increased flexibility for upload of Staged Bug-10477-Alter table import_batches |
Description
Amit Gupta
2013-06-17 05:10:36 UTC
Created attachment 19213 [details] [review] Increased flexibility for upload of Staged When uploading bulk MARC records against existing records need further option to allow the process to just add/merge extra MARC tags rather than having to completely overwrite an existing record or just leave the existing record unchanged. Test Plan: 1. Click on Tools->Stage MARC records for import. 2. Upload the MARC file for ex: first.mrc 3. Click on upload button. 4. Choose Record matching rule: 020$a ISBN. 5. Choose Action if matching record found: Append or update MARC21/UNIMARC tag a text box will appear after choosing enter MARC tag for ex: 700a which you want to merge. 6. Click on Stage for import button. 7. On the next screen click on Manage staged records. 8. You can also edit the record matching rule in manage record screen. 9. Click on Import this batch on catalog button. 10. Next screen will give no of record updated. 11. It will check duplicate field record for ex: 700$aamit is already in record it will skip the tag and move to next. Created attachment 19214 [details] [review] Alter table import_batches Added overlay_action to "appendmarctag" and new column "marctag" Applying: Bug-10477 Increased flexibility for upload of Staged Using index info to reconstruct a base tree... M koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt M tools/manage-marc-import.pl Falling back to patching base and 3-way merge... Auto-merging tools/manage-marc-import.pl Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt Patch failed at 0001 Bug-10477 Increased flexibility for upload of Staged The copy of the patch that failed is found in: /home/christopher/git/koha/.git/rebase-apply/patch When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". Created attachment 22034 [details] [review] Bug-10477 Increased flexibility for upload of Staged When uploading bulk MARC records against existing records need further option to allow the process to just add/merge extra MARC tags rather than having to completely overwrite an existing record or just leave the existing record unchanged. Test Plan: 1. Click on Tools->Stage MARC records for import. 2. Upload the MARC file for ex: first.mrc 3. Click on upload button. 4. Choose Record matching rule: 020$a ISBN. 5. Choose Action if matching record found: Append or update MARC21/UNIMARC tag a text box will appear after choosing enter MARC tag for ex: 700a which you want to merge. 6. Click on Stage for import button. 7. On the next screen click on Manage staged records. 8. You can also edit the record matching rule in manage record screen. 9. Click on Import this batch on catalog button. 10. Next screen will give no of record updated. 11. It will check duplicate field record for ex: 700$aamit is already in record it will skip the tag and move to next. Created attachment 22035 [details] [review] Alter table import_batches Added overlay_action to "appendmarctag" and new column "marctag" Applying: Bug-10477-Alter table import_batches Using index info to reconstruct a base tree... M installer/data/mysql/kohastructure.sql M installer/data/mysql/updatedatabase.pl Falling back to patching base and 3-way merge... Auto-merging installer/data/mysql/updatedatabase.pl CONFLICT (content): Merge conflict in installer/data/mysql/updatedatabase.pl Auto-merging installer/data/mysql/kohastructure.sql Patch failed at 0001 Bug-10477-Alter table import_batches The copy of the patch that failed is found in: /home/christopher/git/koha/.git/rebase-apply/patch When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". Created attachment 22536 [details] [review] Bug-10477 Increased flexibility for upload of Staged When uploading bulk MARC records against existing records need further option to allow the process to just add/merge extra MARC tags rather than having to completely overwrite an existing record or just leave the existing record unchanged. Test Plan: 1. Click on Tools->Stage MARC records for import. 2. Upload the MARC file for ex: first.mrc 3. Click on upload button. 4. Choose Record matching rule: 020$a ISBN. 5. Choose Action if matching record found: Append or update MARC21/UNIMARC tag a text box will appear after choosing enter MARC tag for ex: 700a which you want to merge. 6. Click on Stage for import button. 7. On the next screen click on Manage staged records. 8. You can also edit the record matching rule in manage record screen. 9. Click on Import this batch on catalog button. 10. Next screen will give no of record updated. 11. It will check duplicate field record for ex: 700$aamit is already in record it will skip the tag and move to next. Signed-off-by: Amit Gupta <amitddng135@gmail.com> Created attachment 22537 [details] [review] Bug-10477-Alter table import_batches Added overlay_action to "appendmarctag" and new column "marctag" Created attachment 24066 [details] [review] Bug-10477 Increased flexibility for upload of Staged When uploading bulk MARC records against existing records need further option to allow the process to just add/merge extra MARC tags rather than having to completely overwrite an existing record or just leave the existing record unchanged. Test Plan: 1. Click on Tools->Stage MARC records for import. 2. Upload the MARC file for ex: first.mrc 3. Click on upload button. 4. Choose Record matching rule: 020$a ISBN. 5. Choose Action if matching record found: Append or update MARC21/UNIMARC tag a text box will appear after choosing enter MARC tag for ex: 700a which you want to merge. 6. Click on Stage for import button. 7. On the next screen click on Manage staged records. 8. You can also edit the record matching rule in manage record screen. 9. Click on Import this batch on catalog button. 10. Next screen will give no of record updated. 11. It will check duplicate field record for ex: 700$aamit is already in record it will skip the tag and move to next. Signed-off-by: Amit Gupta <amitddng135@gmail.com> Created attachment 24067 [details] [review] Bug-10477-Alter table import_batches Added overlay_action to "appendmarctag" and new column "marctag" Rebased patches. I did not test. Patch works correctly! thx Patch tested with a sandbox, by Nicolas B. <n.bravais@mairie-decines.fr> Created attachment 24159 [details] [review] Bug-10477 Increased flexibility for upload of Staged When uploading bulk MARC records against existing records need further option to allow the process to just add/merge extra MARC tags rather than having to completely overwrite an existing record or just leave the existing record unchanged. Test Plan: 1. Click on Tools->Stage MARC records for import. 2. Upload the MARC file for ex: first.mrc 3. Click on upload button. 4. Choose Record matching rule: 020$a ISBN. 5. Choose Action if matching record found: Append or update MARC21/UNIMARC tag a text box will appear after choosing enter MARC tag for ex: 700a which you want to merge. 6. Click on Stage for import button. 7. On the next screen click on Manage staged records. 8. You can also edit the record matching rule in manage record screen. 9. Click on Import this batch on catalog button. 10. Next screen will give no of record updated. 11. It will check duplicate field record for ex: 700$aamit is already in record it will skip the tag and move to next. Signed-off-by: Amit Gupta <amitddng135@gmail.com> Signed-off-by: Nicolas B. <n.bravais@mairie-decines.fr> Created attachment 24160 [details] [review] Bug-10477-Alter table import_batches Added overlay_action to "appendmarctag" and new column "marctag" Signed-off-by: Nicolas B. <n.bravais@mairie-decines.fr> Signed-off-by: Nicolas B <n.bravais@mairie-decines.fr> Hello Amit, Could you provide unit tests for changes introduced in modules please? Marked as Failed QA. Comment on attachment 24160 [details] [review] Bug-10477-Alter table import_batches Review of attachment 24160 [details] [review]: ----------------------------------------------------------------- ::: installer/data/mysql/updatedatabase.pl @@ +7914,5 @@ > > +$DBversion = "3.15.00.XXX"; > +if ( CheckVersion($DBversion) ) { > + $dbh->do("ALTER TABLE import_batches MODIFY overlay_action enum('replace', 'create_new', 'use_template', 'ignore', 'appendmarctag') NOT NULL default 'create_new'"); > + $dbh->do("ALTER TABLE import_batches ADD COLUMN marctag mediumtext"); You should probably add an 'AFTER' statement, so that the kohastructure.sql and updatedatabase.pl will generate the same field order. Comment on attachment 24159 [details] [review] Bug-10477 Increased flexibility for upload of Staged Review of attachment 24159 [details] [review]: ----------------------------------------------------------------- ::: C4/ImportBatch.pm @@ +249,5 @@ > + my $sth = $dbh->prepare("UPDATE import_batches SET marctag = ? WHERE import_batch_id = ?"); > + $sth->execute($marctag, $batch_id); > + return; > +} > + When you add functions to a C4 or Koha library, you need to make sure there is a test file. There is no ./t/db_dependent/ImportBatch.t file, which is likely what you need to create, since this requires the import_batches table. The test file generally calls the functions/methods in every way that could be done normally inside code. @@ +724,5 @@ > + $sth->execute($oldxml, $rowref->{'import_record_id'}); > + $sth = $dbh->prepare($query); > + $sth->execute($recordid, $rowref->{'import_record_id'}); > + SetImportRecordOverlayStatus($rowref->{'import_record_id'}, 'match_applied'); > + SetImportRecordStatus($rowref->{'import_record_id'}, 'imported'); And your test file will have to trigger this code segment too. :) ::: tools/manage-marc-import.pl @@ +228,3 @@ > }; > } > $template->param(batch_list => \@list); Make sure your git repo has: git config --global core.whitespace trailing-space,space-before-tab git config --global apply.whitespace fix Did anything ever come of this? The idea of this is still quite interesting. While we can use overlay rules to protect fields, the idea here is to define what is being merged. |