[Bug 29016] New: viewlog.pl - Problem with many entries
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 Bug ID: 29016 Summary: viewlog.pl - Problem with many entries Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Tools Assignee: koha-bugs@lists.koha-community.org Reporter: vitorfernandes87@gmail.com QA Contact: testopia@bugs.koha-community.org The script viewlog.pl it's very slow because it retrieves all action logs at the same time. It should use KohaTables with pagination/number max of returning entries like other Koha tables (API + AJAX wrapper). Test plan: - We need a database with a large number of entries in the action_logs table (200k for example) - Open view logs tool (viewlog.pl) - Select all modules and search - Timeout or a long waiting time -- 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=29016 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #1 from David Cook <dcook@prosentient.com.au> --- I have a library that gets timeouts when trying to use viewlog.pl. The timeouts come from a HTTP forward proxy that times out after 60 seconds, so it would be interesting to have an AJAX driven DataTable that only returned a small number of logs at a time. -- 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=29016 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|viewlog.pl - Problem with |Log viewer has problems |many entries |with many entries -- 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=29016 Andreas Jonsson <andreas.jonsson@kreablo.se> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andreas.jonsson@kreablo.se -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 Marie <marie.hedbom@musikverket.se> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |marie.hedbom@musikverket.se -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com Assignee|koha-bugs@lists.koha-commun |kyle@bywatersolutions.com |ity.org | -- 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=29016 --- Comment #2 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 196370 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196370&action=edit Bug 29016: Add REST API for action logs Patch from commit ab65fd5 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #3 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 196371 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196371&action=edit Bug 29016: Convert log viewer to ajax datatable The script viewlog.pl it's very slow because it retrieves all action logs at the same time. It should use KohaTables with pagination/number max of returning entries like other Koha tables (API + AJAX wrapper). Test Plan: 1) Apply this patch 2) Rebuild swagger file 3) Restart all the things! 4) Browse to /cgi-bin/koha/tools/viewlog.pl 5) Test functionality, functionality should be no different! * Limit by librarian * Limit by modules * Limit by actions * Object search string * Info search string * Limit by interface * Limit by from date * Limit by to date * Limit by from and to date * Test "Compare" checkboxes ( only two should be selectable at once ) * Test column sorting * Test sharable link * Test output to a file * Test columns show/hide -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #4 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 196372 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196372&action=edit Bug 29016: Move strings from js file to tt file Patch from commit d17e427 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #5 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 196373 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196373&action=edit Bug 29016: Add unit tests Patch from commit 46971ca -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196370|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196371|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196372|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196373|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #6 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 196376 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196376&action=edit Bug 29016: Add REST API for action logs Patch from commit ab65fd5 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #7 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 196377 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196377&action=edit Bug 29016: Add unit tests Patch from commit 55d1087 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #8 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 196378 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196378&action=edit Bug 29016: Convert log viewer to ajax datatable The script viewlog.pl it's very slow because it retrieves all action logs at the same time. It should use KohaTables with pagination/number max of returning entries like other Koha tables (API + AJAX wrapper). Test Plan: 1) Apply this patch 2) Rebuild swagger file 3) Restart all the things! 4) Browse to /cgi-bin/koha/tools/viewlog.pl 5) Test functionality, functionality should be no different! * Limit by librarian * Limit by modules * Limit by actions * Object search string * Info search string * Limit by interface * Limit by from date * Limit by to date * Limit by from and to date * Test "Compare" checkboxes ( only two should be selectable at once ) * Test column sorting * Test sharable link * Test output to a file * Test columns show/hide -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #9 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 196379 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196379&action=edit Bug 29016: Move strings from js file to tt file Patch from commit 91fc2a7 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrew@bywatersolutions.com --- Comment #10 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Limiting by module, action, and/or interface via the checkboxes does not work. I get all entries regardless of my selections. Other limits do work. Looking in the Network tab of the browser inspector, I don't see module, action, or interface reflected in the API query that is sent. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Failed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196376|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196377|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196378|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196379|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #11 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 197641 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197641&action=edit Bug 29016: Add REST API for action logs Patch from commit 46a5a36 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #12 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 197642 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197642&action=edit Bug 29016: Add unit tests Patch from commit b4b03bc -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #13 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 197643 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197643&action=edit Bug 29016: Convert log viewer to ajax datatable The script viewlog.pl it's very slow because it retrieves all action logs at the same time. It should use KohaTables with pagination/number max of returning entries like other Koha tables (API + AJAX wrapper). Test Plan: 1) Apply this patch 2) Rebuild swagger file 3) Restart all the things! 4) Browse to /cgi-bin/koha/tools/viewlog.pl 5) Test functionality, functionality should be no different! * Limit by librarian * Limit by modules * Limit by actions * Object search string * Info search string * Limit by interface * Limit by from date * Limit by to date * Limit by from and to date * Test "Compare" checkboxes ( only two should be selectable at once ) * Test column sorting * Test sharable link * Test output to a file * Test columns show/hide -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #14 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 197644 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197644&action=edit Bug 29016: Move strings from js file to tt file Patch from commit 88a55db -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197641|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197642|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197643|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197644|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #15 from David Nind <david@davidnind.com> --- Created attachment 197680 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197680&action=edit Bug 29016: Add REST API for action logs Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #16 from David Nind <david@davidnind.com> --- Created attachment 197681 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197681&action=edit Bug 29016: Add unit tests Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #17 from David Nind <david@davidnind.com> --- Created attachment 197682 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197682&action=edit Bug 29016: Convert log viewer to ajax datatable The script viewlog.pl it's very slow because it retrieves all action logs at the same time. It should use KohaTables with pagination/number max of returning entries like other Koha tables (API + AJAX wrapper). Test Plan: 1) Apply this patch 2) Rebuild swagger file 3) Restart all the things! 4) Browse to /cgi-bin/koha/tools/viewlog.pl 5) Test functionality, functionality should be no different! * Limit by librarian * Limit by modules * Limit by actions * Object search string * Info search string * Limit by interface * Limit by from date * Limit by to date * Limit by from and to date * Test "Compare" checkboxes ( only two should be selectable at once ) * Test column sorting * Test sharable link * Test output to a file * Test columns show/hide Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #18 from David Nind <david@davidnind.com> --- Created attachment 197683 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197683&action=edit Bug 29016: Move strings from js file to tt file Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Medium patch QA Contact|testopia@bugs.koha-communit |martin.renvoize@openfifth.c |y.org |o.uk Depends on| |42032 Sponsorship status|--- |Unsponsored Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42032 [Bug 42032] Add diff support to AUTHORITIES action logs -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197680|0 |1 is obsolete| | Attachment #197681|0 |1 is obsolete| | Attachment #197682|0 |1 is obsolete| | Attachment #197683|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #19 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 198333 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198333&action=edit Bug 29016: Add REST API for action logs Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #20 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 198334 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198334&action=edit Bug 29016: Add unit tests Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #21 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 198335 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198335&action=edit Bug 29016: Convert log viewer to ajax datatable The script viewlog.pl it's very slow because it retrieves all action logs at the same time. It should use KohaTables with pagination/number max of returning entries like other Koha tables (API + AJAX wrapper). Test Plan: 1) Apply this patch 2) Rebuild swagger file 3) Restart all the things! 4) Browse to /cgi-bin/koha/tools/viewlog.pl 5) Test functionality, functionality should be no different! * Limit by librarian * Limit by modules * Limit by actions * Object search string * Info search string * Limit by interface * Limit by from date * Limit by to date * Limit by from and to date * Test "Compare" checkboxes ( only two should be selectable at once ) * Test column sorting * Test sharable link * Test output to a file * Test columns show/hide Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #22 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 198336 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198336&action=edit Bug 29016: Move strings from js file to tt file Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #23 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 198337 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198337&action=edit Bug 29016: (QA follow-up) Add librarian/patron relations to ActionLog QA review noted that the new /api/v1/action_logs endpoint exposed only column data, so the log viewer ended up showing bare borrowernumbers in the Librarian and Object columns where the old server-side rendering showed firstname/surname (borrowernumber). Add the DBIC plumbing needed to support x-koha-embed for those relationships. Two belongs_to relationships are declared below the auto-generated marker on Koha::Schema::Result::ActionLog: * librarian -> borrowers.borrowernumber via action_logs.user * patron -> borrowers.borrowernumber via action_logs.object The patron relation is intentionally polymorphic; the action_logs.object column holds different identifiers per module (biblionumber for CATALOGUING, subscriptionid for SERIAL, ...) so callers must filter by module before trusting the joined patron - this is documented in both schema and Koha::ActionLog comments. Koha::ActionLog gains explicit librarian() and patron() accessor methods following the Koha::Hold pattern, returning Koha::Patron objects (or undef when the relation does not match). The accessors deliberately avoid `use Koha::Patrons` at compile time: Koha::ActionLog is loaded very early via C4::Log and Koha::Patron is not yet defined at that point - the accessors reach for it lazily at call time. koha_object_class / koha_objects_class overrides are also added to bring the result class in line with the rest of the codebase. Test plan: 1. prove t/db_dependent/api/v1/action_logs.t (still green) 2. perl -MKoha::ActionLog -e 'print "ok"' (no circular import) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #24 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 198338 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198338&action=edit Bug 29016: (QA follow-up) Expand action_logs API and test coverage Build on the new ActionLog DBIC relations to expose them as opt-in embeds, and shore up gaps in the test coverage that QA flagged. Swagger * paths/action_logs.yaml declares an x-koha-embed header parameter constrained to the supported relations (librarian, patron). * definitions/action_log.yaml adds the corresponding optional `librarian` and `patron` object fields. Tests * Convert the single 24-test subtest into focused subtests: - authorization (403 vs 200) - simple typed filters - q-DSL: multi-value module, info LIKE, combined filter - embeds: librarian and patron, with and without x-koha-embed - pagination + X-Total-Count and order_by * Mock AuthSuccessLog/AuthFailureLog/BorrowersLog to 0 to remove the flakiness where the API GET itself appended an AUTH log row between delete and assertion. * Build the test librarian with both `tools` and `borrowers` flags so embedded patron fields are not redacted by Koha::Patron->is_accessible. * Use a small build_fixtures() helper to avoid copy-pasting setup across subtests. Test plan: 1. yarn build && restart_all (refresh swagger bundle) 2. prove t/db_dependent/api/v1/action_logs.t (all subtests green) 3. curl -H 'x-koha-embed: librarian,patron' \ /api/v1/action_logs?module=MEMBERS -- patron and librarian objects appear in the response. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #25 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 198339 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198339&action=edit Bug 29016: (QA follow-up) Render embedded patron, fix JS i18n drift QA review pointed out three regressions and a label gap in the new DataTable-driven log viewer: 1. The Librarian column showed a bare borrowernumber linked to the patron page; the old server-side template showed the librarian's full name with the borrowernumber in parentheses. 2. The Object column for MEMBERS / CIRCULATION / FINES / APIKEYS rows showed only the borrowernumber; the old template showed the patron's full name and used "API keys for <name> (<id>)" wording. 3. Several user-visible strings in renderObject() were hard-coded English ("Bibliographic record ", "Subscription ", "Authority ", "Basket ") and would never have been picked up by the translator. 4. The form's Actions list still includes RESTORE but the new str/viewlog.inc action_labels map missed the corresponding entry, so the rendered Action cell fell through to escapeHtml("RESTORE") instead of the localised "Restore". This patch: * Asks the API to embed both `librarian` and `patron` and uses those objects when rendering the Librarian and Object columns. When the embed is absent (e.g. because the relation does not match for a non-MEMBERS row) the renderers fall back to the bare id, preserving backwards compatibility. * Wraps the four hardcoded strings in __() with %s placeholders so the translator extracts them. The Basket markup is also assembled via __("Basket %s").format(...) rather than string concatenation so that translators can re-order the link text. * Adds RESTORE: _("Restore") to str/viewlog.inc. Test plan: 1. Tools -> Log viewer with various modules selected. 2. Verify the Librarian column shows "Firstname Surname (id)" and links to the moremember page. 3. Filter to MEMBERS / CIRCULATION / FINES; verify the Object column shows the patron's full name, and the API keys row uses the "API keys for <name> (<id>)" wording. 4. Filter to CATALOGUING / SERIAL / AUTHORITIES / ACQUISITIONS; verify "Bibliographic record N", "Subscription N", "Authority N" and "Basket N" still link correctly. 5. Restore a deleted biblio (CataloguingLog must be on); verify the Action column shows "Restore" rather than "RESTORE". -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #26 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 198340 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198340&action=edit Bug 29016: (QA follow-up) Translate circulation overrides in info column CIRCULATION rows whose info payload is a JSON object can carry `forced` and `confirmations` arrays listing the override codes a librarian acknowledged when checking out, renewing or otherwise circulating an item (e.g. DEBT, AGE_RESTRICTION, BIBLIO_ALREADY_ISSUED). The old server-rendered template ran these through the translate_log_override SWITCH block in action-logs.inc; in the new AJAX-driven viewer the JS default branch was just escapeHtml()-ing the raw JSON, leaving the codes unlocalised and unreadable. Port the override -> human-readable label map into str/viewlog.inc as override_labels, mirroring the module/action/interface label maps already there. Add a renderCircInfo() helper that recognises the JSON shape and emits the same div.forced / div.confirmed blocks the old template did, so the existing CSS continues to apply. renderInfo() now falls through CIRCULATION -> renderCircInfo, the generic record-info renderer (CATALOGUING / AUTHORITIES from bug 42032) and finally escapeHtml(), so non-JSON payloads (item barcodes, ID-only info, ...) keep displaying as before. Test plan: 1. Enable IssueLog. 2. Trigger an override checkout (e.g. patron with debt, item not for loan) and confirm. 3. Tools -> Log viewer, filter by module=Circulation. 4. The override row's Info column should show one or more localised "Patron had debt", "Item was not for loan", ... lines instead of a raw JSON blob. 5. Plain ISSUE / RETURN rows (no overrides) keep showing the raw itemnumber / barcode payload as before. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #27 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 198341 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198341&action=edit Bug 29016: (QA follow-up) Restore biblio<->item log expansion The catalog detail page links to the modification log with modules=CATALOGUING&object_type=biblio&object=<biblionumber>. The old server-rendered viewer matched both biblio-level entries (object = biblionumber, info LIKE 'biblio%') and item-level entries (object IN (itemnumbers of this biblio), info LIKE 'item%'). Converting to the AJAX DataTable kept that expansion only in the CSV export branch, so the on-screen view silently dropped item-level history. Recreate the expansion in the AJAX path: * tools/viewlog.pl: when (single CATALOGUING module + object_type =biblio + non-empty object) collect the biblio's itemnumbers and expose them, along with object_type, to the template. * viewlog.tt: include object_type and biblio_itemnumbers in the search_params JSON the inline script builds for the JS. * viewlog.js: when those params are present, build the same -or clause the old SQL produced and skip the regular per-object filter. The info substring filter is also suppressed in that branch (the old code did the same: it dropped %info% in favour of the -or). Test plan: 1. Enable CataloguingLog. 2. Edit the biblio and a couple of its items. 3. From the biblio detail page, open "Modification log". 4. Verify the table shows both the biblio MODIFY rows and the item MODIFY rows for that biblio (and only those). 5. From Tools -> Log viewer, plain Cataloguing filter still returns the unfiltered log set as before. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #28 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 198342 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198342&action=edit Bug 29016: (QA follow-up) Document the action_logs list controller Replace the empty =head3 stub with a proper synopsis explaining the URL, the supported filtering / ordering / embed surface, and the permission requirement. Aligns the controller with the documentation density of other Koha REST controllers and removes the "Missing POD" QA noise. Test plan: 1. perl -MKoha::REST::V1::ActionLogs -e '' (still loads) 2. perl -c Koha/REST/V1/ActionLogs.pm (still parses) 3. perldoc Koha/REST/V1/ActionLogs.pm (renders the new POD) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> 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=29016 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #198333|0 |1 is obsolete| | Attachment #198334|0 |1 is obsolete| | Attachment #198335|0 |1 is obsolete| | Attachment #198336|0 |1 is obsolete| | Attachment #198337|0 |1 is obsolete| | Attachment #198338|0 |1 is obsolete| | Attachment #198339|0 |1 is obsolete| | Attachment #198340|0 |1 is obsolete| | Attachment #198341|0 |1 is obsolete| | Attachment #198342|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #29 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 198343 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198343&action=edit Bug 29016: Add REST API for action logs Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #30 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 198344 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198344&action=edit Bug 29016: Add unit tests Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #31 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 198345 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198345&action=edit Bug 29016: Convert log viewer to ajax datatable The script viewlog.pl it's very slow because it retrieves all action logs at the same time. It should use KohaTables with pagination/number max of returning entries like other Koha tables (API + AJAX wrapper). Test Plan: 1) Apply this patch 2) Rebuild swagger file 3) Restart all the things! 4) Browse to /cgi-bin/koha/tools/viewlog.pl 5) Test functionality, functionality should be no different! * Limit by librarian * Limit by modules * Limit by actions * Object search string * Info search string * Limit by interface * Limit by from date * Limit by to date * Limit by from and to date * Test "Compare" checkboxes ( only two should be selectable at once ) * Test column sorting * Test sharable link * Test output to a file * Test columns show/hide Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #32 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 198346 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198346&action=edit Bug 29016: Move strings from js file to tt file Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #33 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 198347 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198347&action=edit Bug 29016: (QA follow-up) Add librarian/patron relations to ActionLog QA review noted that the new /api/v1/action_logs endpoint exposed only column data, so the log viewer ended up showing bare borrowernumbers in the Librarian and Object columns where the old server-side rendering showed firstname/surname (borrowernumber). Add the DBIC plumbing needed to support x-koha-embed for those relationships. Two belongs_to relationships are declared below the auto-generated marker on Koha::Schema::Result::ActionLog: * librarian -> borrowers.borrowernumber via action_logs.user * patron -> borrowers.borrowernumber via action_logs.object The patron relation is intentionally polymorphic; the action_logs.object column holds different identifiers per module (biblionumber for CATALOGUING, subscriptionid for SERIAL, ...) so callers must filter by module before trusting the joined patron - this is documented in both schema and Koha::ActionLog comments. Koha::ActionLog gains explicit librarian() and patron() accessor methods following the Koha::Hold pattern, returning Koha::Patron objects (or undef when the relation does not match). The accessors deliberately avoid `use Koha::Patrons` at compile time: Koha::ActionLog is loaded very early via C4::Log and Koha::Patron is not yet defined at that point - the accessors reach for it lazily at call time. koha_object_class / koha_objects_class overrides are also added to bring the result class in line with the rest of the codebase. Test plan: 1. prove t/db_dependent/api/v1/action_logs.t (still green) 2. perl -MKoha::ActionLog -e 'print "ok"' (no circular import) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #34 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 198348 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198348&action=edit Bug 29016: (QA follow-up) Expand action_logs API and test coverage Build on the new ActionLog DBIC relations to expose them as opt-in embeds, and shore up gaps in the test coverage that QA flagged. Swagger * paths/action_logs.yaml declares an x-koha-embed header parameter constrained to the supported relations (librarian, patron). * definitions/action_log.yaml adds the corresponding optional `librarian` and `patron` object fields. Tests * Convert the single 24-test subtest into focused subtests: - authorization (403 vs 200) - simple typed filters - q-DSL: multi-value module, info LIKE, combined filter - embeds: librarian and patron, with and without x-koha-embed - pagination + X-Total-Count and order_by * Mock AuthSuccessLog/AuthFailureLog/BorrowersLog to 0 to remove the flakiness where the API GET itself appended an AUTH log row between delete and assertion. * Build the test librarian with both `tools` and `borrowers` flags so embedded patron fields are not redacted by Koha::Patron->is_accessible. * Use a small build_fixtures() helper to avoid copy-pasting setup across subtests. Test plan: 1. yarn build && restart_all (refresh swagger bundle) 2. prove t/db_dependent/api/v1/action_logs.t (all subtests green) 3. curl -H 'x-koha-embed: librarian,patron' \ /api/v1/action_logs?module=MEMBERS -- patron and librarian objects appear in the response. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #35 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 198349 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198349&action=edit Bug 29016: (QA follow-up) Render embedded patron, fix JS i18n drift QA review pointed out three regressions and a label gap in the new DataTable-driven log viewer: 1. The Librarian column showed a bare borrowernumber linked to the patron page; the old server-side template showed the librarian's full name with the borrowernumber in parentheses. 2. The Object column for MEMBERS / CIRCULATION / FINES / APIKEYS rows showed only the borrowernumber; the old template showed the patron's full name and used "API keys for <name> (<id>)" wording. 3. Several user-visible strings in renderObject() were hard-coded English ("Bibliographic record ", "Subscription ", "Authority ", "Basket ") and would never have been picked up by the translator. 4. The form's Actions list still includes RESTORE but the new str/viewlog.inc action_labels map missed the corresponding entry, so the rendered Action cell fell through to escapeHtml("RESTORE") instead of the localised "Restore". This patch: * Asks the API to embed both `librarian` and `patron` and uses those objects when rendering the Librarian and Object columns. When the embed is absent (e.g. because the relation does not match for a non-MEMBERS row) the renderers fall back to the bare id, preserving backwards compatibility. * Wraps the four hardcoded strings in __() with %s placeholders so the translator extracts them. The Basket markup is also assembled via __("Basket %s").format(...) rather than string concatenation so that translators can re-order the link text. * Adds RESTORE: _("Restore") to str/viewlog.inc. Test plan: 1. Tools -> Log viewer with various modules selected. 2. Verify the Librarian column shows "Firstname Surname (id)" and links to the moremember page. 3. Filter to MEMBERS / CIRCULATION / FINES; verify the Object column shows the patron's full name, and the API keys row uses the "API keys for <name> (<id>)" wording. 4. Filter to CATALOGUING / SERIAL / AUTHORITIES / ACQUISITIONS; verify "Bibliographic record N", "Subscription N", "Authority N" and "Basket N" still link correctly. 5. Restore a deleted biblio (CataloguingLog must be on); verify the Action column shows "Restore" rather than "RESTORE". -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #36 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 198350 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198350&action=edit Bug 29016: (QA follow-up) Translate circulation overrides in info column CIRCULATION rows whose info payload is a JSON object can carry `forced` and `confirmations` arrays listing the override codes a librarian acknowledged when checking out, renewing or otherwise circulating an item (e.g. DEBT, AGE_RESTRICTION, BIBLIO_ALREADY_ISSUED). The old server-rendered template ran these through the translate_log_override SWITCH block in action-logs.inc; in the new AJAX-driven viewer the JS default branch was just escapeHtml()-ing the raw JSON, leaving the codes unlocalised and unreadable. Port the override -> human-readable label map into str/viewlog.inc as override_labels, mirroring the module/action/interface label maps already there. Add a renderCircInfo() helper that recognises the JSON shape and emits the same div.forced / div.confirmed blocks the old template did, so the existing CSS continues to apply. renderInfo() now falls through CIRCULATION -> renderCircInfo, the generic record-info renderer (CATALOGUING / AUTHORITIES from bug 42032) and finally escapeHtml(), so non-JSON payloads (item barcodes, ID-only info, ...) keep displaying as before. Test plan: 1. Enable IssueLog. 2. Trigger an override checkout (e.g. patron with debt, item not for loan) and confirm. 3. Tools -> Log viewer, filter by module=Circulation. 4. The override row's Info column should show one or more localised "Patron had debt", "Item was not for loan", ... lines instead of a raw JSON blob. 5. Plain ISSUE / RETURN rows (no overrides) keep showing the raw itemnumber / barcode payload as before. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #37 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 198351 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198351&action=edit Bug 29016: (QA follow-up) Restore biblio<->item log expansion The catalog detail page links to the modification log with modules=CATALOGUING&object_type=biblio&object=<biblionumber>. The old server-rendered viewer matched both biblio-level entries (object = biblionumber, info LIKE 'biblio%') and item-level entries (object IN (itemnumbers of this biblio), info LIKE 'item%'). Converting to the AJAX DataTable kept that expansion only in the CSV export branch, so the on-screen view silently dropped item-level history. Recreate the expansion in the AJAX path: * tools/viewlog.pl: when (single CATALOGUING module + object_type =biblio + non-empty object) collect the biblio's itemnumbers and expose them, along with object_type, to the template. * viewlog.tt: include object_type and biblio_itemnumbers in the search_params JSON the inline script builds for the JS. * viewlog.js: when those params are present, build the same -or clause the old SQL produced and skip the regular per-object filter. The info substring filter is also suppressed in that branch (the old code did the same: it dropped %info% in favour of the -or). Test plan: 1. Enable CataloguingLog. 2. Edit the biblio and a couple of its items. 3. From the biblio detail page, open "Modification log". 4. Verify the table shows both the biblio MODIFY rows and the item MODIFY rows for that biblio (and only those). 5. From Tools -> Log viewer, plain Cataloguing filter still returns the unfiltered log set as before. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #38 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 198352 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198352&action=edit Bug 29016: (QA follow-up) Document the action_logs list controller Replace the empty =head3 stub with a proper synopsis explaining the URL, the supported filtering / ordering / embed surface, and the permission requirement. Aligns the controller with the documentation density of other Koha REST controllers and removes the "Missing POD" QA noise. Test plan: 1. perl -MKoha::REST::V1::ActionLogs -e '' (still loads) 2. perl -c Koha/REST/V1/ActionLogs.pm (still parses) 3. perldoc Koha/REST/V1/ActionLogs.pm (renders the new POD) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Keywords| |rel_26_05_candidate, | |RM_priority -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #39 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- prove xt/api.t # Failed test 'No tag errors in the spec' # at xt/api.t line 130. # Structures begin differing at: # $got->[0] = 'get /action_logs -> uses tag 'action_logs' not present in top level list' # $expected->[0] = Does not exist get /action_logs -> uses tag 'action_logs' not present in top level list # Looks like you failed 1 test of 1. not ok 4 - tags tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #40 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 198648 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198648&action=edit Bug 29016: (RM follow-up) Add action_logs tag to swagger def Patch from commit 44b894f -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |26.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #41 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Nice work everyone! Pushed to main for 26.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_26_05_candidate, |release-notes-needed |RM_priority | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 Laura O'Neil <laura@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |laura@bywatersolutions.com Keywords| |rel_25_11_candidate -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #42 from Laura O'Neil <laura@bywatersolutions.com> --- Is it possible to backport this to 25.11.xx? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #43 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- *** Bug 41208 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #44 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 198845 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198845&action=edit Bug 29016 [25.11.x]: Add REST API for action logs Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #45 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 198846 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198846&action=edit Bug 29016 [25.11.x]: Add unit tests Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #46 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 198847 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198847&action=edit Bug 29016 [25.11.x]: Convert log viewer to ajax datatable The script viewlog.pl it's very slow because it retrieves all action logs at the same time. It should use KohaTables with pagination/number max of returning entries like other Koha tables (API + AJAX wrapper). Test Plan: 1) Apply this patch 2) Rebuild swagger file 3) Restart all the things! 4) Browse to /cgi-bin/koha/tools/viewlog.pl 5) Test functionality, functionality should be no different! * Limit by librarian * Limit by modules * Limit by actions * Object search string * Info search string * Limit by interface * Limit by from date * Limit by to date * Limit by from and to date * Test "Compare" checkboxes ( only two should be selectable at once ) * Test column sorting * Test sharable link * Test output to a file * Test columns show/hide Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #47 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 198848 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198848&action=edit Bug 29016 [25.11.x]: Move strings from js file to tt file Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #48 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 198849 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198849&action=edit Bug 29016 [25.11.x]: (QA follow-up) Add librarian/patron relations to ActionLog QA review noted that the new /api/v1/action_logs endpoint exposed only column data, so the log viewer ended up showing bare borrowernumbers in the Librarian and Object columns where the old server-side rendering showed firstname/surname (borrowernumber). Add the DBIC plumbing needed to support x-koha-embed for those relationships. Two belongs_to relationships are declared below the auto-generated marker on Koha::Schema::Result::ActionLog: * librarian -> borrowers.borrowernumber via action_logs.user * patron -> borrowers.borrowernumber via action_logs.object The patron relation is intentionally polymorphic; the action_logs.object column holds different identifiers per module (biblionumber for CATALOGUING, subscriptionid for SERIAL, ...) so callers must filter by module before trusting the joined patron - this is documented in both schema and Koha::ActionLog comments. Koha::ActionLog gains explicit librarian() and patron() accessor methods following the Koha::Hold pattern, returning Koha::Patron objects (or undef when the relation does not match). The accessors deliberately avoid `use Koha::Patrons` at compile time: Koha::ActionLog is loaded very early via C4::Log and Koha::Patron is not yet defined at that point - the accessors reach for it lazily at call time. koha_object_class / koha_objects_class overrides are also added to bring the result class in line with the rest of the codebase. Test plan: 1. prove t/db_dependent/api/v1/action_logs.t (still green) 2. perl -MKoha::ActionLog -e 'print "ok"' (no circular import) Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #49 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 198850 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198850&action=edit Bug 29016 [25.11.x]: (QA follow-up) Expand action_logs API and test coverage Build on the new ActionLog DBIC relations to expose them as opt-in embeds, and shore up gaps in the test coverage that QA flagged. Swagger * paths/action_logs.yaml declares an x-koha-embed header parameter constrained to the supported relations (librarian, patron). * definitions/action_log.yaml adds the corresponding optional `librarian` and `patron` object fields. Tests * Convert the single 24-test subtest into focused subtests: - authorization (403 vs 200) - simple typed filters - q-DSL: multi-value module, info LIKE, combined filter - embeds: librarian and patron, with and without x-koha-embed - pagination + X-Total-Count and order_by * Mock AuthSuccessLog/AuthFailureLog/BorrowersLog to 0 to remove the flakiness where the API GET itself appended an AUTH log row between delete and assertion. * Build the test librarian with both `tools` and `borrowers` flags so embedded patron fields are not redacted by Koha::Patron->is_accessible. * Use a small build_fixtures() helper to avoid copy-pasting setup across subtests. Test plan: 1. yarn build && restart_all (refresh swagger bundle) 2. prove t/db_dependent/api/v1/action_logs.t (all subtests green) 3. curl -H 'x-koha-embed: librarian,patron' \ /api/v1/action_logs?module=MEMBERS -- patron and librarian objects appear in the response. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #50 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 198851 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198851&action=edit Bug 29016 [25.11.x]: (QA follow-up) Render embedded patron, fix JS i18n drift QA review pointed out three regressions and a label gap in the new DataTable-driven log viewer: 1. The Librarian column showed a bare borrowernumber linked to the patron page; the old server-side template showed the librarian's full name with the borrowernumber in parentheses. 2. The Object column for MEMBERS / CIRCULATION / FINES / APIKEYS rows showed only the borrowernumber; the old template showed the patron's full name and used "API keys for <name> (<id>)" wording. 3. Several user-visible strings in renderObject() were hard-coded English ("Bibliographic record ", "Subscription ", "Authority ", "Basket ") and would never have been picked up by the translator. 4. The form's Actions list still includes RESTORE but the new str/viewlog.inc action_labels map missed the corresponding entry, so the rendered Action cell fell through to escapeHtml("RESTORE") instead of the localised "Restore". This patch: * Asks the API to embed both `librarian` and `patron` and uses those objects when rendering the Librarian and Object columns. When the embed is absent (e.g. because the relation does not match for a non-MEMBERS row) the renderers fall back to the bare id, preserving backwards compatibility. * Wraps the four hardcoded strings in __() with %s placeholders so the translator extracts them. The Basket markup is also assembled via __("Basket %s").format(...) rather than string concatenation so that translators can re-order the link text. * Adds RESTORE: _("Restore") to str/viewlog.inc. Test plan: 1. Tools -> Log viewer with various modules selected. 2. Verify the Librarian column shows "Firstname Surname (id)" and links to the moremember page. 3. Filter to MEMBERS / CIRCULATION / FINES; verify the Object column shows the patron's full name, and the API keys row uses the "API keys for <name> (<id>)" wording. 4. Filter to CATALOGUING / SERIAL / AUTHORITIES / ACQUISITIONS; verify "Bibliographic record N", "Subscription N", "Authority N" and "Basket N" still link correctly. 5. Restore a deleted biblio (CataloguingLog must be on); verify the Action column shows "Restore" rather than "RESTORE". Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #51 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 198852 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198852&action=edit Bug 29016 [25.11.x]: (QA follow-up) Translate circulation overrides in info column CIRCULATION rows whose info payload is a JSON object can carry `forced` and `confirmations` arrays listing the override codes a librarian acknowledged when checking out, renewing or otherwise circulating an item (e.g. DEBT, AGE_RESTRICTION, BIBLIO_ALREADY_ISSUED). The old server-rendered template ran these through the translate_log_override SWITCH block in action-logs.inc; in the new AJAX-driven viewer the JS default branch was just escapeHtml()-ing the raw JSON, leaving the codes unlocalised and unreadable. Port the override -> human-readable label map into str/viewlog.inc as override_labels, mirroring the module/action/interface label maps already there. Add a renderCircInfo() helper that recognises the JSON shape and emits the same div.forced / div.confirmed blocks the old template did, so the existing CSS continues to apply. renderInfo() now falls through CIRCULATION -> renderCircInfo, the generic record-info renderer (CATALOGUING / AUTHORITIES from bug 42032) and finally escapeHtml(), so non-JSON payloads (item barcodes, ID-only info, ...) keep displaying as before. Test plan: 1. Enable IssueLog. 2. Trigger an override checkout (e.g. patron with debt, item not for loan) and confirm. 3. Tools -> Log viewer, filter by module=Circulation. 4. The override row's Info column should show one or more localised "Patron had debt", "Item was not for loan", ... lines instead of a raw JSON blob. 5. Plain ISSUE / RETURN rows (no overrides) keep showing the raw itemnumber / barcode payload as before. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #52 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 198853 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198853&action=edit Bug 29016 [25.11.x]: (QA follow-up) Restore biblio<->item log expansion The catalog detail page links to the modification log with modules=CATALOGUING&object_type=biblio&object=<biblionumber>. The old server-rendered viewer matched both biblio-level entries (object = biblionumber, info LIKE 'biblio%') and item-level entries (object IN (itemnumbers of this biblio), info LIKE 'item%'). Converting to the AJAX DataTable kept that expansion only in the CSV export branch, so the on-screen view silently dropped item-level history. Recreate the expansion in the AJAX path: * tools/viewlog.pl: when (single CATALOGUING module + object_type =biblio + non-empty object) collect the biblio's itemnumbers and expose them, along with object_type, to the template. * viewlog.tt: include object_type and biblio_itemnumbers in the search_params JSON the inline script builds for the JS. * viewlog.js: when those params are present, build the same -or clause the old SQL produced and skip the regular per-object filter. The info substring filter is also suppressed in that branch (the old code did the same: it dropped %info% in favour of the -or). Test plan: 1. Enable CataloguingLog. 2. Edit the biblio and a couple of its items. 3. From the biblio detail page, open "Modification log". 4. Verify the table shows both the biblio MODIFY rows and the item MODIFY rows for that biblio (and only those). 5. From Tools -> Log viewer, plain Cataloguing filter still returns the unfiltered log set as before. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #53 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 198854 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198854&action=edit Bug 29016 [25.11.x]: (QA follow-up) Document the action_logs list controller Replace the empty =head3 stub with a proper synopsis explaining the URL, the supported filtering / ordering / embed surface, and the permission requirement. Aligns the controller with the documentation density of other Koha REST controllers and removes the "Missing POD" QA noise. Test plan: 1. perl -MKoha::REST::V1::ActionLogs -e '' (still loads) 2. perl -c Koha/REST/V1/ActionLogs.pm (still parses) 3. perldoc Koha/REST/V1/ActionLogs.pm (renders the new POD) Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #54 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 198855 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198855&action=edit Bug 29016 [25.11.x]: (RM follow-up) Add action_logs tag to swagger def Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |42643 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42643 [Bug 42643] [OMNIBUS] Assorted performance and stability work -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 trevor.diamond@mainlib.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |trevor.diamond@mainlib.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 Jacob O'Mara <jacob.omara@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Pushed to stable Version(s)|26.05.00 |26.05.00,25.11.05 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 --- Comment #55 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Thanks all, pushed to 25.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Initiative type|--- |Epic -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |26.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Log viewer has problems |Improve performance of the |with many entries |Log viewer when working | |with a high volume of | |action logs -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |baptiste.wojtkowski@biblibr | |e.com Status|Pushed to stable |Pushed to oldstable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |41358 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41358 [Bug 41358] action logs info column should always store JSON -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |43017 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43017 [Bug 43017] [OMNIBUS] Interface optimization -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29016 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|42643 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42643 [Bug 42643] [OMNIBUS] Assorted performance and stability work -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org