Using Debian packages: koha:~# dpkg -l | grep koha ii koha-common 17.05.01-1 all integrated (physical) library management system ii libcgi-session-driver-memcached-perl 0.04-1koha2 all Perl module to allow CGI sessions to be stored in memcache ii libconvert-basen-perl 0.01-1koha1 all perl module for encoding and decoding of base{2,4,8,16,32,64} strings ii libdbix-runsql-perl 0.14-1~koha1 all module to run an SQL file via a DBI handle ii libjson-validator-perl 0.67+dfsg-1~koha1 all module to validate data against a JSON schema ii libmarc-record-perl 2.0.6-1koha1 all Perl extension for handling MARC records ii libmojolicious-perl 6.15+dfsg-1~koha1 all simple, yet powerful, Web Application Framework ii libpdf-fromhtml-perl 0.31-1~koha1 all module to convert HTML documents to PDF ii libpdf-reuse-perl 0.36-1koha1 all Reuse and mass produce PDF documents ii libpdf-writer-perl 0.06-1~koha1 all PDF writer abstraction layer ii libswagger2-perl 0.77-1~koha1 all Perl module for generating, parsing and transforming swagger API documentation ii libtemplate-plugin-htmltotext-perl 0.03-1koha1 all Plugin interface to HTML::FormatText ii libtemplate-plugin-json-escape-perl 0.2-1koha1 all module for embedding JSON strings in Template Toolkit ii libtemplate-plugin-stash-perl 1.006-1~koha1 all Template::Toolkit plugin that exposes the template's stash # koha-rebuild-zebra -f -v koha returns a lot of errors: [...] error retrieving biblio 94540 at /usr/share/koha/bin/migration_tools/rebuild_zebra.pl line 683, <DATA> line 751. error retrieving biblio 94541 at /usr/share/koha/bin/migration_tools/rebuild_zebra.pl line 683, <DATA> line 751. error retrieving biblio 94542 at /usr/share/koha/bin/migration_tools/rebuild_zebra.pl line 683, <DATA> line 751. error retrieving biblio 94543 at /usr/share/koha/bin/migration_tools/rebuild_zebra.pl line 683, <DATA> line 751. error retrieving biblio 94544 at /usr/share/koha/bin/migration_tools/rebuild_zebra.pl line 683, <DATA> line 751. error retrieving biblio 94545 at /usr/share/koha/bin/migration_tools/rebuild_zebra.pl line 683, <DATA> line 751. error retrieving biblio 94546 at /usr/share/koha/bin/migration_tools/rebuild_zebra.pl line 683, <DATA> line 751. error retrieving biblio 94547 at /usr/share/koha/bin/migration_tools/rebuild_zebra.pl line 683, <DATA> line 751. error retrieving biblio 94548 at /usr/share/koha/bin/migration_tools/rebuild_zebra.pl line 683, <DATA> line 751. error retrieving biblio 94549 at /usr/share/koha/bin/migration_tools/rebuild_zebra.pl line 683, <DATA> line 751. [...] Although the 'use' is clearly defined: use C4::Biblio; specifying the full perl library/function name in those 2 files fixes it: for p in /usr/share/koha/bin/migration_tools/rebuild_zebra.pl /usr/share/koha/lib/C4/Items.pm; do for f in GetMarcFromKohaField GetMarcBiblio GetBiblionumberFromItemnumber TransformKohaToMarc GetFrameworkCode; do sed -i -e "s/$f/C4::Biblio::$f/g" $p done done
Jef, I have the same problem in a production installation. I need your opinion about to follow your suggestion to fix it. I've open bz #19101 because a similar problem.
Jef, The problem was fixed in my installation aplying your suggestion. I think this bug is not an enhancement but a major or critical one.
*** Bug 19101 has been marked as a duplicate of this bug. ***
Created attachment 66823 [details] [review] Bug 18927: Use fully qualified subroutine names in C4::Items rebuild_zebra.pl fails in some conditions (perl version?) I do not recreate but it has been reported that reindex fails with: error retrieving biblio 94540 at /usr/share/koha/bin/migration_tools/rebuild_zebra.pl line 683, <DATA> line 751. To fix it we can use fully qualified subroutine names for: GetMarcFromKohaField GetMarcBiblio GetBiblionumberFromItemnumber TransformKohaToMarc GetFrameworkCode Test plan: Confirm the rebuild_zebra script still works correctly after this patch
Created attachment 66850 [details] [review] Bug 18927: Use fully qualified subroutine names in C4::Items rebuild_zebra.pl fails in some conditions (perl version?) I do not recreate but it has been reported that reindex fails with: error retrieving biblio 94540 at /usr/share/koha/bin/migration_tools/rebuild_zebra.pl line 683, <DATA> line 751. To fix it we can use fully qualified subroutine names for: GetMarcFromKohaField GetMarcBiblio GetBiblionumberFromItemnumber TransformKohaToMarc GetFrameworkCode Test plan: Confirm the rebuild_zebra script still works correctly after this patch Signed-off-by: Lee Jamison <ldjamison@marywood.edu> Script works correctly after patch is applied.
Created attachment 66869 [details] [review] Bug 18927: Use fully qualified subroutine names in C4::Items rebuild_zebra.pl fails in some conditions (perl version?) I do not recreate but it has been reported that reindex fails with: error retrieving biblio 94540 at /usr/share/koha/bin/migration_tools/rebuild_zebra.pl line 683, <DATA> line 751. To fix it we can use fully qualified subroutine names for: GetMarcFromKohaField GetMarcBiblio GetBiblionumberFromItemnumber TransformKohaToMarc GetFrameworkCode Test plan: Confirm the rebuild_zebra script still works correctly after this patch Signed-off-by: Lee Jamison <ldjamison@marywood.edu> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Workaround. Looks good to me. But we still do not know what disturbs perl somewhere in those C4 modules..
Pushed to master for 17.11, thanks to everybody involved!
Depends on Bug 19040 but I can easily adapt for 17.05.x
Pushed to 17.05.x, will be in 17.05.04.
This patch has been pushed to 16.11.x and will be in 16.11.12.
How would I go about applying this particular patch? I just ran into this on a production instance.
(In reply to jfowler from comment #12) > How would I go about applying this particular patch? I just ran into this on > a production instance. If you are using 16.05.x, 16.11.x or 17.05.x, you just need to upgrade using apt.
After recent upgrade to 17.05.04.000 bulkmarcimport started to fail on all items attempted to be added. ERROR: Adding items to bib 1 failed: Undefined subroutine &C4::Items::TransformMarcToKoha called at /usr/share/koha/lib/C4/Items.pm line 382, <GEN46> line 1 So I manually added the prefix and the next error came up: ERROR: Adding items to bib 74925 failed: Undefined subroutine &C4::Items::GetMarcStructure called at /usr/share/koha/lib/C4/Items.pm line 2307, <GEN46> line 14. Manually adding the prefix to that line seems to have worked, but it does not feel like the right solution.
(In reply to Ian Bays from comment #15) > After recent upgrade to 17.05.04.000 bulkmarcimport started to fail on all > items attempted to be added. i created a separate bug for this... bug 19687
(In reply to Katrin Fischer from comment #11) > This patch has been pushed to 16.11.x and will be in 16.11.12. Pushed to 16.05.x, for 16.05.17 release
This is an interesting one... I have the exact same Koha code running on Debian Jessie and OpenSUSE. The code on OpenSUSE works fine, but the code on Debian is creating the error reported in this bug. Debian is Perl 5.20.2 using Koha apt repository and Debian apt repo for dependencies. Exporter is 5.71. OpenSUSE is Perl 5.18.2 using CPAN for dependencies. Exporter is 5.68. -- Doesn't look like there's anything important in the Exporter changelog: https://metacpan.org/changes/distribution/Exporter. -- Hmm, the C4::Items::Item2Marc function looks exactly the same in 17.05.xx as it does in older versions of Koha that worked fine on Debian. When I try the older Koha library code on Debian with a little script I've written, it works fine (notwithstanding expected database schema errors). It's an issue with the newer Koha library code... The exports look basically the same in C4::Biblio between versions. -- So it looks like something we must have done... yet it also looks like it depends on the system Perl too. Going to try a different Perl on OpenSUSE and see if that makes a difference...
(In reply to Marcel de Rooy from comment #7) > Workaround. Looks good to me. But we still do not know what disturbs perl > somewhere in those C4 modules.. This is what is really bothering me... In Item2Marc, I'm doing the following: my @keys = keys %C4::Items::; use Data::Dumper; warn Dumper(\@keys); This outputs the following: $VAR1 = [ 'ModClassSource', 'getFacets', 'ModClassSortRule', 'getnbpages', 'GetLogs', 'GetMarcStructure', 'GetItemnumberFromBarcode', 'AddItem', 'b', 'ItemSafeToDelete', 'GetLatestAcquisitions', 'GetSourcesForSortRule', 'GetVariationsOfISSN', 'GetItemnumbersForBiblio', 'MoveItemFromBiblio', 'ShelfToCart', 'GetItemsByBiblioitemnumber', 'GetItemsLocationInfo', 'Dumper', 'ISA', 'get_itemnumbers_of', 'getitemtypeinfo', 'GetNormalizedOCLCNumber', 'ModZebra', 'CartToShelf', 'GetClassSortRules', 'GetVariationsOfISBN', 'ToggleNewStatus', 'ModItemTransfer', 'ModItem', 'GetFrameworkCode', 'output_pref', 'import', 'GetItem', 'GetItemInfosOf', '_parse_unlinked_item_subfields_from_xml', '__ANON__', 'GetClassSources', 'CheckItemPreSave', '_set_derived_columns_for_mod', 'getitemtypeimagedir', 'xml_escape', 'BEGIN', '_repack_item_errors', 'AddClassSource', '_find_value', 'GetMarcBiblio', 'cronlogaction', '_do_column_fixes_for_mod', 'any', '_set_derived_columns_for_add', 'dt_from_string', '_set_defaults_for_add', 'Item2Marc', '_build_default_values_for_mod_marc', 'GetAnalyticsCount', 'GetNormalizedEAN', '_mod_item_dates', 'displaylog', '_get_single_item_column', 'getitemtypeimagesrc', '_get_unlinked_subfields_xml', 'GetHiddenItemnumbers', 'GetNormalizedUPC', 'get_hostitemnumbers_of', 'GetNormalizedISBN', 'SearchItemsByField', 'EXPORT', 'GetPrinter', 'DEBUG', 'a', 'GetVariationsOfISBNs', 'ModDateLastSeen', 'Load', 'AddItemFromMarc', 'GetLastAcquisitions', 'GetItemsInfo', 'carp', 'TransformKohaToMarc', 'GetHostItemsInfo', '_get_unlinked_item_subfields', 'GetMarcItem', 'ModItemFromMarc', 'GetClassSort', 'DelItem', 'GetItemTypesCategorized', 'AUTOLOAD', 'format_sqldatetime', 'GetBarcodeFromItemnumber', 'GetLogStatus', 'getallthemes', '_marc_from_item_hash', 'AddClassSortRule', 'getitemtypeimagelocation', '_calc_items_cn_sort', 'GetPrinters', '_koha_delete_item', 'SearchItems', 'DelClassSource', 'GetClassSortRule', 'GetVariationsOfISSNs', '_SearchItems_build_where_fragment', 'NormalizeISBN', 'TransformMarcToKoha', 'GetClassSource', 'NormalizeISSN', 'GetMarcFromKohaField', 'DelItemCheck', 'GetAuthorisedValues', 'confess', 'GetLostItems', 'PrepareItemrecordDisplay', 'DelClassSortRule', '_koha_modify_item', 'AddItemBatchFromMarc', 'logaction', 'croak', 'IsMarcStructureInternal', '_koha_new_item', 'GetItemsForInventory' ]; TransformKohaToMarc appears in that list. I can use "carp" or "C4::Items::carp", but I can't use "TransformKohaToMarc" or "C4::Items::TransformKohaToMarc". But the function seems to have been imported...