https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40680
--- Comment #5 from David Cook <[email protected]> --- Once I'm on a fully started up container using KOHA_IMAGE=main-trixie, I do this simple test: perl -MC4::Auth -e "warn 'bowwow';" This yields many warnings: Attempt to call undefined import method with arguments ("get_session") via package "C4::Auth" (Perhaps you forgot to load the package?) at /kohadevbox/koha/C4/Search/History.pm line 5. Attempt to call undefined import method with arguments ("get_template_and_user") via package "C4::Auth" (Perhaps you forgot to load the package?) at /kohadevbox/koha/C4/Output.pm line 33. Attempt to call undefined import method with arguments ("GetNormalizedISBN" ...) via package "C4::Koha" (Perhaps you forgot to load the package?) at /kohadevbox/koha/Koha/Biblio.pm line 27. Attempt to call undefined import method with arguments ("haspermission") via package "C4::Auth" (Perhaps you forgot to load the package?) at /kohadevbox/koha/C4/Serials.pm line 37. Attempt to call undefined import method with arguments ("UpdateStats") via package "C4::Stats" (Perhaps you forgot to load the package?) at /kohadevbox/koha/C4/Circulation.pm line 28. Attempt to call undefined import method with arguments ("CheckReserves" ...) via package "C4::Reserves" (Perhaps you forgot to load the package?) at /kohadevbox/koha/C4/Circulation.pm line 30. Attempt to call undefined import method with arguments ("barcodedecode") via package "C4::Circulation" (Perhaps you forgot to load the package?) at /kohadevbox/koha/C4/Items.pm line 49. Attempt to call undefined import method with arguments ("getitemtypeimagelocation") via package "C4::Koha" (Perhaps you forgot to load the package?) at /kohadevbox/koha/Koha/ItemType.pm line 20. Attempt to call undefined import method with arguments ("GetPreparedLetter" ...) via package "C4::Letters" (Perhaps you forgot to load the package?) at /kohadevbox/koha/C4/Message.pm line 24. Attempt to call undefined import method with arguments ("UpdateStats") via package "C4::Stats" (Perhaps you forgot to load the package?) at /kohadevbox/koha/Koha/Account.pm line 28. Attempt to call undefined import method with arguments ("GetFine") via package "C4::Overdues" (Perhaps you forgot to load the package?) at /kohadevbox/koha/Koha/Account.pm line 29. Attempt to call undefined import method with arguments ("checkpw_hash") via package "C4::Auth" (Perhaps you forgot to load the package?) at /kohadevbox/koha/Koha/Patron.pm line 30. Attempt to call undefined import method with arguments ("GetPreparedLetter" ...) via package "C4::Letters" (Perhaps you forgot to load the package?) at /kohadevbox/koha/Koha/Patron.pm line 32. Attempt to call undefined import method with arguments ("AddReturn") via package "C4::Circulation" (Perhaps you forgot to load the package?) at /kohadevbox/koha/Koha/Checkouts.pm line 23. Attempt to call undefined import method with arguments ("AddRenewal" ...) via package "C4::Circulation" (Perhaps you forgot to load the package?) at /kohadevbox/koha/Koha/Checkout.pm line 26. Attempt to call undefined import method with arguments ("CanBookBeIssued" ...) via package "C4::Circulation" (Perhaps you forgot to load the package?) at /kohadevbox/koha/Koha/CurbsidePickup.pm line 26. Attempt to call undefined import method with arguments ("GetMessagingPreferences") via package "C4::Members::Messaging" (Perhaps you forgot to load the package?) at /kohadevbox/koha/Koha/CurbsidePickup.pm line 27. Attempt to call undefined import method with arguments ("GetPreparedLetter" ...) via package "C4::Letters" (Perhaps you forgot to load the package?) at /kohadevbox/koha/Koha/CurbsidePickup.pm line 28. Attempt to call undefined import method with arguments ("barcodedecode" ...) via package "C4::Circulation" (Perhaps you forgot to load the package?) at /kohadevbox/koha/Koha/Item.pm line 29. Attempt to call undefined import method with arguments ("GetBranchItemRule") via package "C4::Circulation" (Perhaps you forgot to load the package?) at /kohadevbox/koha/C4/HoldsQueue.pm line 26. Attempt to call undefined import method with arguments ("UpdateStats") via package "C4::Stats" (Perhaps you forgot to load the package?) at /kohadevbox/koha/Koha/Recalls.pm line 28. Attempt to call undefined import method with arguments ("GetPreparedLetter" ...) via package "C4::Letters" (Perhaps you forgot to load the package?) at /kohadevbox/koha/Koha/Hold.pm line 26. Attempt to call undefined import method with arguments ("GetAuthorisedValues") via package "C4::Koha" (Perhaps you forgot to load the package?) at /kohadevbox/koha/Koha/ILL/Request/Logger.pm line 23. Attempt to call undefined import method with arguments ("CanBookBeIssued" ...) via package "C4::Circulation" (Perhaps you forgot to load the package?) at /kohadevbox/koha/Koha/ILL/Request.pm line 49. Attempt to call undefined import method with arguments ("GetPreparedLetter") via package "C4::Letters" (Perhaps you forgot to load the package?) at /kohadevbox/koha/C4/Members.pm line 29. bowwow at -e line 1. If we re-factor C4::Auth's internals to move "use C4::Context;" and all the Exporter stuff to above our Koha module loads, then we can eliminate the warnings for C4::Auth in this list. -- This suggests that it is indeed an issue with how we setup the Exporter. If you look carefully at files like C4::Auth, the way we set up the Exporter makes no sense. Let's look at another example... Attempt to call undefined import method with arguments ("GetNormalizedISBN" ...) via package "C4::Koha" (Perhaps you forgot to load the package?) at /kohadevbox/koha/Koha/Biblio.pm line 27. The 27th line of Koha::Biblio is the following: use C4::Koha qw( GetNormalizedISBN GetNormalizedUPC GetNormalizedOCLCNumber ); We move the Exporter block up to under Modern::Perl, and we re-run this code: perl -MC4::Auth -e "warn 'bowwow';" And sure enough the warnings for C4::Koha disappear from the list as well. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
