Bug 7755

Summary: C4::Items::GetAnalyticsCount needs C4::Search
Product: Koha Reporter: Julian Maurice <julian.maurice>
Component: Architecture, internals, and plumbingAssignee: Julian Maurice <julian.maurice>
Status: CLOSED FIXED QA Contact: Ian Walls <koha.sekjal>
Severity: normal    
Priority: P3 CC: jonathan.druart, magnus
Version: Main   
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:    
Bug Blocks: 7162    
Attachments: use C4::Search in C4::Items

Description Julian Maurice 2012-03-20 10:59:43 UTC
GetAnalyticsCount needs some C4::Search subs but there is no 'use C4::Search' in C4::Items.

This can cause GetAnalyticsCount to fail if called in a context where C4::Search is not loaded.

This blocks bug 7162
Comment 1 Julian Maurice 2012-03-20 11:02:42 UTC
Created attachment 8340 [details] [review]
use C4::Search in C4::Items

GetAnalyticsCount needs subs from C4::Search
Comment 2 Magnus Enger 2012-03-23 09:54:07 UTC
How can this be tested? Do you have one or more examples of where GetAnalyticsCount fails, because C4::Search is not loaded?
Comment 3 Julian Maurice 2012-03-23 14:09:29 UTC
Problem was discovered testing the patch for bug 7162 which use C4::Items::DelItemCheck (which use GetAnalyticsCount). I don't know where DelItemCheck is used, but you can apply this patch and patch for bug 7162, and try to cancel an order line (in basket.pl or parcel.pl)
Comment 4 Jonathan Druart 2012-04-06 11:35:39 UTC
C4::Search is already used in C4/Items.pm

use C4::Search qw/SimpleSearch/;
Comment 5 Julian Maurice 2012-04-06 11:42:55 UTC
ok so this patch is not useful anymore. marking as resolved.