Summary: | Add tomarcplugin option to bulkmarcimport.pl | ||
---|---|---|---|
Product: | Koha | Reporter: | David Gustafsson <glasklas> |
Component: | Tools | Assignee: | David Gustafsson <glasklas> |
Status: | Patch doesn't apply --- | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | david, frank.hansen, olivier.hubert |
Version: | Main | Keywords: | no-sandbox |
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | 29440 | ||
Bug Blocks: | |||
Attachments: |
Bug 29597: Add tomarcplugin option to bulkmarcimport.pl
ToMarcExample.pm biblios.marc.tar.gz |
Description
David Gustafsson
2021-11-30 12:22:17 UTC
Created attachment 128181 [details] [review] 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 Created attachment 128182 [details]
ToMarcExample.pm
Created attachment 128361 [details]
biblios.marc.tar.gz
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 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 |