[Bug 18208] New: Add RecordProcessor filter to inject not onloan count to MARC records
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18208 Bug ID: 18208 Summary: Add RecordProcessor filter to inject not onloan count to MARC records Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: gmcharlt@gmail.com Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18208 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com Assignee|gmcharlt@gmail.com |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18208 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18208 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 60812 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=60812&action=edit Bug 18208: Add RecordProcessor filter to inject not onloan count to MARC records This patch adds a new filter for MARC records to be used with Koha::RecordProcessor. It's purpose is to inject the information about items not-onloan in a fixed subfield, 999$x. To test: - Apply the patch - Run: $ prove t/db_dependent/Koha/Filter/EmbedItemsAvailability.t => SUCCESS: Tests pass! - Sign off :-D Sponsored-by: ByWater Solutions -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18208 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #60812|0 |1 is obsolete| | --- Comment #2 from Marc Véron <veron@veron.ch> --- Created attachment 60815 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=60815&action=edit Bug 18208: Add RecordProcessor filter to inject not onloan count to MARC records This patch adds a new filter for MARC records to be used with Koha::RecordProcessor. It's purpose is to inject the information about items not-onloan in a fixed subfield, 999$x. To test: - Apply the patch - Run: $ prove t/db_dependent/Koha/Filter/EmbedItemsAvailability.t => SUCCESS: Tests pass! - Sign off :-D Sponsored-by: ByWater Solutions Followed test plan, test passes OK Signed-off-by: Marc Véron <veron@veron.ch> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18208 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |veron@veron.ch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18208 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |18098 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18098 [Bug 18098] Add an index with the count of not onloan items -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18208 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #3 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- my $items = Koha::Items->search({ biblionumber => $biblionumber }); + + while ( my $item = $items->next ) { + $not_onloan_items++ + if not $item->onloan; + } Can't you combine that in one statement? In general: Do I understand correctly that this is not an optional filter? We will always save the not onloan count to 999$x? Can you also add some explanation on this report why we definitely need it? At this point we are not using it in the codebase. But if we should do after some time, would it feel good to rely on a field in the search engine when we can generate the count in one Koha::Items call ? No blockers, just convince me.. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18208 --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Marcel de Rooy from comment #3)
my $items = Koha::Items->search({ biblionumber => $biblionumber }); + + while ( my $item = $items->next ) { + $not_onloan_items++ + if not $item->onloan; + } Can't you combine that in one statement?
In general: Do I understand correctly that this is not an optional filter? We will always save the not onloan count to 999$x? Can you also add some explanation on this report why we definitely need it? At this point we are not using it in the codebase. But if we should do after some time, would it feel good to rely on a field in the search engine when we can generate the count in one Koha::Items call ? No blockers, just convince me..
The record will always inject that. And is going to be used on indexing only. See bug 18098. When it comes to filtering search results (records with available items this time) we need the index for being able to build the filtering query. We already do that but the query is not working, and this way writing the query seems straightfowrad. Just check if the index has a value higher than 0. Period. RecordProcessor filters should be used for lots of things (specially stuff done in C4::Biblios) like embedding items... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18208 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #60815|0 |1 is obsolete| | --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 61964 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61964&action=edit Bug 18208: Add RecordProcessor filter to inject not onloan count to MARC records This patch adds a new filter for MARC records to be used with Koha::RecordProcessor. It's purpose is to inject the information about items not-onloan in a fixed subfield, 999$x. To test: - Apply the patch - Run: $ prove t/db_dependent/Koha/Filter/EmbedItemsAvailability.t => SUCCESS: Tests pass! - Sign off :-D Sponsored-by: ByWater Solutions Followed test plan, test passes OK Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18208 --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 61965 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=61965&action=edit Bug 18208: [QA Follow-up] Get count from Koha::Items Removes the loop by moving the onloan test to the query. Test plan: Run the test again. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18208 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18208 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18208 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com Status|Passed QA |Pushed to Master --- Comment #7 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to master for 17.05, thanks Tomas, Marcel! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18208 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |RESOLVED CC| |katrin.fischer@bsz-bw.de Resolution|--- |FIXED --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- This won't get ported back to 16.11.x as it is an enhancement. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18208 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |18579 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18579 [Bug 18579] Problem with :Filter::MARC::EmbedItemsAvailability -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org