[Bug 29597] New: Add tomarcplugin option to bulkmarcimport.pl
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29597 Bug ID: 29597 Summary: Add tomarcplugin option to bulkmarcimport.pl Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Tools Assignee: koha-bugs@lists.koha-community.org Reporter: glasklas@gmail.com QA Contact: testopia@bugs.koha-community.org This patch provides a tomarcplugin option for bulkmarcimport.pl. There already is a "localcust" option that provides kind of the same functionality, but an option for providing a plugin is for example useful as "to_marc"-plugins can also selected in the "Format" dropdown when staging imports in the staff interface. So if there for example are some marc transformations/processing that should be enforced both routes of import a plugin can be created and used in both cases. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29597 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |29440 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29440 [Bug 29440] Refactor/clean up bulkmarcimport.pl -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29597 --- Comment #1 from David Gustafsson <glasklas@gmail.com> --- Created attachment 128181 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=128181&action=edit Bug 29597: Add tomarcplugin option to bulkmarcimport.pl Add tomarcplugin option to bulkmarcimport script. To test: 1) Place ToMarcExample.pm in a Koha plugin directory at Koha/Plugin/ToMarcExample.pm and make sure its enabled and installed in Koha 2) Import some biblio with ./bulkmarcimport.pl -v -b -file biblios.mrc -insert -update -c=MARC21 -n=1 -tomarcplugin="Koha::Plugin::ToMarcExample" 3) For the imported biblio, check that field 590a has been populated with the value 'ToMarcExample added field' Sponsored-by: Gothenburg University Library -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29597 --- Comment #2 from David Gustafsson <glasklas@gmail.com> --- Created attachment 128182 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=128182&action=edit ToMarcExample.pm -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29597 --- Comment #3 from David Gustafsson <glasklas@gmail.com> --- Created attachment 128361 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=128361&action=edit biblios.marc.tar.g -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29597 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #128361|biblios.marc.tar.g |biblios.marc.tar.gz description| | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29597 Frank Hansen <frank.hansen@ub.lu.se> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |frank.hansen@ub.lu.se -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29597 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29597 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |glasklas@gmail.com |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29597 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #4 from David Nind <david@davidnind.com> --- I started to test (using koha-testing-docker), but the plugin for step 1 of the test plan does not show in the list of plugins. This is what I did: 1. Applied the patch (it still applies cleanly). 2. Downloaded and put ToMarcExample.pm in the Koha/Plugins directory. 3. Restarted everything. 4. Went to Koha Administration > Plugins > Manage plugins 5. There are no new plugins listed. 6. Even though I didn't see the plugin, I ran the script (from the /kohadevbox/koha directory, with the sample MARC file in that directory as well). This is the output I got: misc/migration_tools/bulkmarcimport.pl -v -b -file biblios.marc -insert -update -c=MARC21 -n=1 -tomarcplugin="Koha::Plugin::ToMarcExample" Using -update without -match or -isbn seems to be useless. Characteristic MARC flavour: MARC21 Plugin does not have method to_marc at /kohadevbox/koha/Koha/Plugins/Handler.pm line 72. Use of uninitialized value $fh in eof at /usr/share/perl5/MARC/File/USMARC.pm line 51. Use of uninitialized value $fh in eof at /usr/share/perl5/MARC/File/USMARC.pm line 51. Use of uninitialized value $fh in eof at /usr/share/perl5/MARC/File/USMARC.pm line 51. 0 MARC records done in 0.00819301605224609 seconds -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29597 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |no-sandbox -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29597 Olivier Hubert <olivier.hubert@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply CC| |olivier.hubert@inlibro.com --- Comment #5 from Olivier Hubert <olivier.hubert@inlibro.com> --- It seems the current patch does not apply anymore: git bz apply 29597 Bug 29597 - Add tomarcplugin option to bulkmarcimport.pl 128181 - Bug 29597: Add tomarcplugin option to bulkmarcimport.pl Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 29597: Add tomarcplugin option to bulkmarcimport.pl error: sha1 information is lacking or useless (misc/migration_tools/bulkmarcimport.pl). error: could not build fake ancestor Patch failed at 0001 Bug 29597: Add tomarcplugin option to bulkmarcimport.pl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29597 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #128181|0 |1 is obsolete| | --- Comment #6 from David Gustafsson <glasklas@gmail.com> --- Created attachment 178168 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=178168&action=edit Bug 29597: Add tomarcplugin option to bulkmarcimport.pl Add tomarcplugin option to bulkmarcimport script. To test: 1) Place ToMarcExample.pm in a Koha plugin directory at Koha/Plugin/ToMarcExample.pm and make sure its enabled and installed in Koha 2) Import some biblio with ./bulkmarcimport.pl -v -b -file biblios.mrc -insert -update -c=MARC21 -n=1 -tomarcplugin="Koha::Plugin::ToMarcExample" 3) For the imported biblio, check that field 590a has been populated with the value 'ToMarcExample added field' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29597 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff --- Comment #7 from David Gustafsson <glasklas@gmail.com> --- Rebased against main. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29597 --- Comment #8 from David Nind <david@davidnind.com> --- The patch still applies. However, I still don't understand how to do step 1 of the test plan. Can you please provide step-by-step instructions for that step? See comment #4. Is this a "normal" plugin that is managed at Koha administration > Plugins > Manage plugins? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29597 Bug 29597 depends on bug 29440, which changed state. Bug 29440 Summary: Refactor/clean up bulkmarcimport.pl https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29440 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29597 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Status|Needs Signoff |Failed QA --- Comment #9 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- [FAIL] misc/migration_tools/bulkmarcimport.pl FAIL critic Bareword file handle opened at line 273, column 9. See pages 202,204 of PBP. (Severity: 5) Two-argument "open" used at line 273, column 9. See page 207 of PBP. (Severity: 5) FAIL tidiness File is not tidy, please run `perl misc/devel/tidy.pl misc/migration_tools/bulkmarcimport.pl` -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29597 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #178168|0 |1 is obsolete| | --- Comment #10 from David Gustafsson <glasklas@gmail.com> --- Created attachment 189775 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=189775&action=edit Bug 29597: Add tomarcplugin option to bulkmarcimport.pl Add tomarcplugin option to bulkmarcimport script. To test: 1) Place ToMarcExample.pm in a Koha plugin directory at Koha/Plugin/ToMarcExample.pm and make sure its enabled and installed in Koha 2) Import some biblio with ./bulkmarcimport.pl -v -b -file biblios.mrc -insert -update -c=MARC21 -n=1 -tomarcplugin="Koha::Plugin::ToMarcExample" 3) For the imported biblio, check that field 590a has been populated with the value 'ToMarcExample added field' Sponsored-by: Gothenburg University Library -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29597 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #11 from David Gustafsson <glasklas@gmail.com> --- Fixed QA-issues. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29597 --- Comment #12 from David Gustafsson <glasklas@gmail.com> --- (In reply to David Nind from comment #8)
The patch still applies.
However, I still don't understand how to do step 1 of the test plan.
Can you please provide step-by-step instructions for that step? See comment #4.
Is this a "normal" plugin that is managed at Koha administration > Plugins > Manage plugins?
I think you should just be able to place it in the plugins directory as per the test instructions. It's a normal Koha plugin ( a to_marc plugin, that can currently be used when staging imports for example) that should appear in the Manage Plugins page. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29597 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #128182|0 |1 is obsolete| | --- Comment #13 from David Gustafsson <glasklas@gmail.com> --- Created attachment 189800 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=189800&action=edit ToMarcExamplePlugin -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29597 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #189775|0 |1 is obsolete| | --- Comment #14 from David Gustafsson <glasklas@gmail.com> --- Created attachment 189801 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=189801&action=edit Bug 29597: Add tomarcplugin option to bulkmarcimport.pl Add tomarcplugin option to bulkmarcimport script. To test: 1) Place ToMarcExample.pm in a Koha plugin directory at Koha/Plugin/ToMarcExample.pm and make sure its enabled and installed in Koha 2) Import some biblio with ./bulkmarcimport.pl -v -b -file biblios.marc -insert -c=MARC21 -n=1 -tomarcplugin="Koha::Plugin::ToMarcExample" 3) For the imported biblio, check that field 590a has been populated with the value 'ToMarcExample added field' Sponsored-by: Gothenburg University Library -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29597 --- Comment #15 from David Gustafsson <glasklas@gmail.com> --- @David Nind, Sorry, tried it out myself now and don't know if it used to work by just putting in the plugins directory, or if I was just sloppy when testing initially, but now the plugin has been packaged properly and needs to be uploaded as a normal Koha plugin to work. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29597 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #189801|0 |1 is obsolete| | --- Comment #16 from David Gustafsson <glasklas@gmail.com> --- Created attachment 189802 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=189802&action=edit Bug 29597: Add tomarcplugin option to bulkmarcimport.pl Add tomarcplugin option to bulkmarcimport script. To test: 1) Upload and enable the ToMarcExample plugin in Administer > Plugins 2) Import some biblio with ./bulkmarcimport.pl -v -b -file biblios.marc -insert -c=MARC21 -n=1 -tomarcplugin="Koha::Plugin::ToMarcExample" 3) For the imported biblio, check that field 590a has been populated with the value 'ToMarcExample added field' Sponsored-by: Gothenburg University Library -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29597 --- Comment #17 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I've used the attached plugin and records for testing this and can confirm it works as intended. :) I used: ./misc/migration_tools/bulkmarcimport.pl -b --file biblios.marc -tomarcplugin="Koha::Plugin::ToMarcExample" Nice to see that the test plan has been adjusted as well! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29597 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Comma delimited| |Gothenburg University list of Sponsors| |Library Sponsorship status|--- |Sponsored Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29597 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #189802|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29597 --- Comment #18 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 200807 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200807&action=edit Bug 29597: Add tomarcplugin option to bulkmarcimport.pl Add tomarcplugin option to bulkmarcimport script. To test: 1) Upload and enable the ToMarcExample plugin in Administer > Plugins 2) Import some biblio with ./bulkmarcimport.pl -v -b -file biblios.marc -insert -c=MARC21 -n=1 -tomarcplugin="Koha::Plugin::ToMarcExample" 3) For the imported biblio, check that field 590a has been populated with the value 'ToMarcExample added field' Sponsored-by: Gothenburg University Library Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org