[Bug 43617] New: COUNTER 5.1 SUSHI parser drops usage data when a Report_Item has multiple Attribute_Performance entries
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43617 Bug ID: 43617 Summary: COUNTER 5.1 SUSHI parser drops usage data when a Report_Item has multiple Attribute_Performance entries Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: ERM Assignee: koha-bugs@lists.koha-community.org Reporter: thibaud.guillot@biblibre.com QA Contact: testopia@bugs.koha-community.org CC: jonathan.druart@gmail.com, jonathan.field@openfifth.co.uk, martin.renvoize@openfifth.co.uk, matt.blenkinsop@openfifth.co.uk, pedro.amorim@openfifth.co.uk Target Milestone: --- Hello, COUNTER 5.1 introduced Attribute_Performance, an array nested inside a single Report_Item. A platform or database that serves several content types gets several entries in this array for the same Report_Item. So I tried to fix that with the following patch -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43617 Thibaud Guillot (thibaud_g) <thibaud.guillot@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Comma delimited| |BibLibre list of Sponsors| | Status|NEW |Needs Signoff Sponsorship status|--- |Sponsored -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43617 --- Comment #1 from Thibaud Guillot (thibaud_g) <thibaud.guillot@biblibre.com> --- Created attachment 206655 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206655&action=edit Bug 43617: Handle multiple Attribute_Performance entries Assisted by Sonnet to build unit test Test plan: 1) Apply the patch 2) Run this one-liner, which builds a COUNTER 5.1 CSV report the same way Koha does when harvesting via SUSHI, from a JSON response modeling a real-world case: a Platform Report where one platform ("nature.com") reports both Searches_Platform and Total_Item_Requests via two Attribute_Performance entries, and another ("Springer Nature Link") reports Total_Item_Requests spread across three content types (Journal, Book, Reference_Work) via three Attribute_Performance entries: perl -Ilib -e ' use Modern::Perl; use JSON qw( decode_json ); use File::Slurp; use Koha::ERM::EUsage::SushiCounter; my $data = decode_json(read_file( "t/db_dependent/data/erm/eusage/COUNTER_5.1/PR_P1.json")); my $counter = Koha::ERM::EUsage::SushiCounter->new({ response => $data }); print $counter->get_COUNTER_from_SUSHI; ' Without patch, the body only contains: nature.com,Total_Item_Requests,60,10,20,30 - the Searches_Platform row for nature.com is missing entirely, and Total_Item_Requests for Springer Nature Link only reflects the Reference_Work entry (60) instead of the sum of all three (111). With patch, the body contains: nature.com,Searches_Platform,330,100,110,120 nature.com,Total_Item_Requests,180,50,60,70 "Springer Nature Link",Total_Item_Requests,111,16,37,58 3) Run the unit tests: prove -v t/db_dependent/Koha/ERM/EUsage/COUNTER_5.1/SushiCounter.t Sponsored-by: BibLibre Assisted-by: Sonnet 5 (Anthropic) -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org