When I submit a Mana comment on a subscription the process completes successfully but in the console this error is returned: Can't locate object method "find" via package "Koha::Resource_comments" (perhaps you forgot to load "Koha::Resource_comments"?) at /home/vagrant/kohaclone/Koha/SharedContent.pm line 89.
Not tackling the cause of this directly (ie why is it requesting a module that doesn't exist and hasn't be loaded into the code) but what about having something like this before line 89: my $loaded = $packages->VERSION; if(!$loaded) { eval('use '.$packages); if(!$packages->VERSION) { warn "Can't load package $packages: $!\n"; } }
(In reply to Jon Knight from comment #1) > Not tackling the cause of this directly (ie why is it requesting a module > that doesn't exist and hasn't be loaded into the code) but what about having > something like this before line 89: > > my $loaded = $packages->VERSION; > if(!$loaded) { > eval('use '.$packages); > if(!$packages->VERSION) { > warn "Can't load package $packages: $!\n"; > } > } We usually use Module::Load::Conditional, but yes it is the same idea.
Created attachment 90379 [details] [review] Bug 22249: Mana - Move comment process in a dedicated sub https://bugs.koha-community.org/show_bug.cgi?id=22259
Created attachment 90380 [details] [review] Bug 22249: Mana - Move comment process in a dedicated sub
Hi Alex, any test plan? Thank You.
Created attachment 90917 [details] [review] Bug 22249: Mana - Move comment process in a dedicated sub Test plan: - Go to a subscription's detail page, - click on "Report mistake" => "New comment", - check Koha logs file, - you can see the following warning: Can't locate object method "find" via package "Koha::Resource_comments" - Apply this patch, - same test again, - no wraning
(In reply to Michal Denar from comment #5) > Hi Alex, > any test plan? > > Thank You. Hello Michal, Just added that in the commit message. Thx!
Kyle, Patch rebased.
Created attachment 90941 [details] [review] Bug 22249: Mana - Move comment process in a dedicated sub Test plan: - Go to a subscription's detail page, - click on "Report mistake" => "New comment", - check Koha logs file, - you can see the following warning: Can't locate object method "find" via package "Koha::Resource_comments" - Apply this patch, - same test again, - no wraning Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 91798 [details] [review] Bug 22249: Mana - Move comment process in a dedicated sub Test plan: - Go to a subscription's detail page, - click on "Report mistake" => "New comment", - check Koha logs file, - you can see the following warning: Can't locate object method "find" via package "Koha::Resource_comments" - Apply this patch, - same test again, - no wraning Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Nice work! Pushed to master for 19.11.00
Pushed to 19.05.x for 19.05.03
missing dependency for 18.11.x, no backport