[Bug 41902] New: Allow configuration of bibliographic information to be shown on new record duplicate check
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41902 Bug ID: 41902 Summary: Allow configuration of bibliographic information to be shown on new record duplicate check Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Cataloging Assignee: koha-bugs@lists.koha-community.org Reporter: andrew@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: m.de.rooy@rijksmuseum.nl In cataloging, when Koha suspects a newly-created record is a duplicate it gives just the title of the existing record. We'd like a system preference in which to use Template Toolkit to define parts of the biblio object to be shown here. -- 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=41902 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |martin.renvoize@openfifth.c |ity.org |o.uk Status|NEW |Needs Signoff Patch complexity|--- |Small 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=41902 --- Comment #1 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 197170 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197170&action=edit Bug 41902: Add DuplicateCheckAdditionalInfo system preference Adds a new system preference 'DuplicateCheckAdditionalInfo' which accepts a Template Toolkit template for displaying additional bibliographic information when a duplicate record is suspected during cataloguing. The preference is a textarea that accepts TT syntax with the 'biblio' variable (a Koha::Biblio object) available for use. When empty (the default), existing behaviour is unchanged. -- You are receiving this mail because: You are watching all bug changes.
Record structure with an empty default value
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41902 --- Comment #2 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 197171 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197171&action=edit Bug 41902: Display additional biblio info on duplicate check When a duplicate record is suspected during cataloguing, render the DuplicateCheckAdditionalInfo system preference (a Template Toolkit template) and display the result alongside the existing duplicate title link. The template is rendered using Koha::TemplateUtils::process_tt, which provides the standard sandboxed TT environment used for non-notice template processing in Koha (no EVAL_PERL, no file inclusion, transactional rollback). The Koha::Biblio object for the suspected duplicate is passed as the 'biblio' variable. Template processing errors are caught and logged via Koha::Logger rather than allowed to interrupt the cataloguing workflow; on error, the duplicate warning still renders without the additional info. The output is rendered with the | \$raw filter as the template content is admin-configured (same trust level as notices). Test plan: 1. Apply the patch and run the database update (perl installer/data/mysql/updatedatabase.pl) 2. Confirm the new system preference 'DuplicateCheckAdditionalInfo' appears under Administration > System preferences > Cataloguing 3. Attempt to add a new bibliographic record that matches an existing record (same title and author, or same ISBN). Confirm the existing 'Duplicate record suspected' warning still shows the title link only - no behaviour change when the syspref is empty 4. Set DuplicateCheckAdditionalInfo to: [% biblio.author %] ([% biblio.copyrightdate %]) 5. Repeat the duplicate-triggering record entry. Confirm the author and publication year now appear below the title link in the duplicate warning 6. Try a more complex template using related objects, e.g.: Publisher: [% biblio.biblioitems.first.publishercode %]<br/> ISBN: [% biblio.biblioitems.first.isbn %]<br/> Items: [% biblio.items.count %] Confirm all values render correctly 7. Set the preference to invalid TT, e.g.: [% biblio.nonexistent_method %] Confirm the duplicate warning still renders (without the additional info) and an error is logged in the Plack error log - the cataloguing workflow must not be interrupted 8. Clear the preference value. Confirm the additional info section disappears and only the title link remains 9. Confirm that when modifying an existing record (not creating a new one) no duplicate check fires, regardless of the preference value -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41902 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |33030 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33030 [Bug 33030] Add standardized subroutine for processing Template Toolkit syntax outside of notices -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41902 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |42346 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42346 [Bug 42346] Add per-language template snippet system for translatable Template Toolkit sysprefs -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41902 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com --- Comment #3 from Jonathan Druart <jonathan.druart@gmail.com> --- + INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) We no longer need options, explanation and type. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41902 --- Comment #4 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- (In reply to Jonathan Druart from comment #3)
+ INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type)
We no longer need options, explanation and type.
Doh.. old habits die hard -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41902 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197170|0 |1 is obsolete| | Attachment #197171|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=41902 --- Comment #5 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 197378 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197378&action=edit Bug 41902: Add DuplicateCheckAdditionalInfo system preference Adds a new system preference 'DuplicateCheckAdditionalInfo' which accepts a Template Toolkit template for displaying additional bibliographic information when a duplicate record is suspected during cataloguing. The preference is a textarea that accepts TT syntax with the 'biblio' variable (a Koha::Biblio object) available for use. When empty (the default), existing behaviour is unchanged. -- You are receiving this mail because: You are watching all bug changes.
Record structure with an empty default value
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41902 --- Comment #6 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 197379 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197379&action=edit Bug 41902: Display additional biblio info on duplicate check When a duplicate record is suspected during cataloguing, render the DuplicateCheckAdditionalInfo system preference (a Template Toolkit template) and display the result alongside the existing duplicate title link. The template is rendered using Koha::TemplateUtils::process_tt, which provides the standard sandboxed TT environment used for non-notice template processing in Koha (no EVAL_PERL, no file inclusion, transactional rollback). The Koha::Biblio object for the suspected duplicate is passed as the 'biblio' variable. Template processing errors are caught and logged via Koha::Logger rather than allowed to interrupt the cataloguing workflow; on error, the duplicate warning still renders without the additional info. The output is rendered with the | \$raw filter as the template content is admin-configured (same trust level as notices). Test plan: 1. Apply the patch and run the database update (perl installer/data/mysql/updatedatabase.pl) 2. Confirm the new system preference 'DuplicateCheckAdditionalInfo' appears under Administration > System preferences > Cataloguing 3. Attempt to add a new bibliographic record that matches an existing record (same title and author, or same ISBN). Confirm the existing 'Duplicate record suspected' warning still shows the title link only - no behaviour change when the syspref is empty 4. Set DuplicateCheckAdditionalInfo to: [% biblio.author %] ([% biblio.copyrightdate %]) 5. Repeat the duplicate-triggering record entry. Confirm the author and publication year now appear below the title link in the duplicate warning 6. Try a more complex template using related objects, e.g.: Publisher: [% biblio.biblioitems.first.publishercode %]<br/> ISBN: [% biblio.biblioitems.first.isbn %]<br/> Items: [% biblio.items.count %] Confirm all values render correctly 7. Set the preference to invalid TT, e.g.: [% biblio.nonexistent_method %] Confirm the duplicate warning still renders (without the additional info) and an error is logged in the Plack error log - the cataloguing workflow must not be interrupted 8. Clear the preference value. Confirm the additional info section disappears and only the title link remains 9. Confirm that when modifying an existing record (not creating a new one) no duplicate check fires, regardless of the preference value -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41902 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Comma delimited| |Main Library Alliance list of Sponsors| |<https://www.mainlib.org/> Sponsorship status|--- |Sponsored -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41902 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197378|0 |1 is obsolete| | Attachment #197379|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=41902 --- Comment #7 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 197474 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197474&action=edit Bug 41902: Add StaffDuplicateCheckPage location to record_display Add a new 'StaffDuplicateCheckPage' location to the record_display category in the Additional Contents admin UI (Tools > Additional Contents). This allows administrators to configure custom bibliographic information to display when a duplicate record is suspected during cataloguing. This uses the existing AdditionalContents infrastructure (bug 39860) rather than a system preference, providing per-branch and multilingual support. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41902 --- Comment #8 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 197475 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197475&action=edit Bug 41902: Display additional biblio info on duplicate check When a duplicate record is suspected during cataloguing, query the AdditionalContents record_display category for the StaffDuplicateCheckPage location. If configured, process the content as a Template Toolkit template with the duplicate biblio object and display the rendered result in the duplicate warning. The TT context variable is 'biblio' (a Koha::Biblio object), so administrators can use expressions like: [% biblio.author %] ([% biblio.copyrightdate %]) Content is scrubbed using the record_display scrubber for XSS safety. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41902 --- Comment #9 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- An example with some formatting and value pulled from the MARC: <b>Full title:</b> <i>[% biblio.title %][% biblio.subtitle %]</i><br> <b>Author:</b> [% biblio.author %]<br> <b>Copyright:</b> [% biblio.copyrightdate %]<br> <b>Bib created:</b> [% biblio.datecreated %]<br> <b>Framework:</b> [% biblio.frameworkcode %]<br> <b>Itemtype:</b> [% biblio.itemtype %]<br> [%- IF biblio.record.subfield('856','u') %] <b>URL:</b> [% biblio.record.subfield('856','u') %] [% END %] -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41902 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This enhancement adds a way release notes| |to display more | |bibliographic information | |when Koha suspects a | |newly-created bibliographic | |record may be a duplicate | |of an existing record. This | |is done through "Tools" > | |"Additional content" > | |"Record display | |customizations", using the | |new display location of | |StaffDuplicateCheckPage. | |Information to be displayed | |is defined in | |TemplateToolkit and styled | |with HTML. Available data | |includes the contents of | |the biblio table and the | |full MARC record. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41902 Andrew Fuerste-Henry <andrew@bywatersolutions.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=41902 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197474|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=41902 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197475|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=41902 --- Comment #10 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 197536 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197536&action=edit Bug 41902: Add StaffDuplicateCheckPage location to record_display Add a new 'StaffDuplicateCheckPage' location to the record_display category in the Additional Contents admin UI (Tools > Additional Contents). This allows administrators to configure custom bibliographic information to display when a duplicate record is suspected during cataloguing. This uses the existing AdditionalContents infrastructure (bug 39860) rather than a system preference, providing per-branch and multilingual support. Signed-off-by: Jeanne Mauriello <jeanne.mauriello@mainlib.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41902 --- Comment #11 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 197537 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197537&action=edit Bug 41902: Display additional biblio info on duplicate check When a duplicate record is suspected during cataloguing, query the AdditionalContents record_display category for the StaffDuplicateCheckPage location. If configured, process the content as a Template Toolkit template with the duplicate biblio object and display the rendered result in the duplicate warning. The TT context variable is 'biblio' (a Koha::Biblio object), so administrators can use expressions like: [% biblio.author %] ([% biblio.copyrightdate %]) Content is scrubbed using the record_display scrubber for XSS safety. Signed-off-by: Jeanne Mauriello <jeanne.mauriello@mainlib.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41902 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |lucas@bywatersolutions.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41902 Lucas Gass (lukeg) <lucas@bywatersolutions.com> 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=41902 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197536|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=41902 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197537|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=41902 --- Comment #12 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 197949 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197949&action=edit Bug 41902: Add StaffDuplicateCheckPage location to record_display Add a new 'StaffDuplicateCheckPage' location to the record_display category in the Additional Contents admin UI (Tools > Additional Contents). This allows administrators to configure custom bibliographic information to display when a duplicate record is suspected during cataloguing. This uses the existing AdditionalContents infrastructure (bug 39860) rather than a system preference, providing per-branch and multilingual support. Signed-off-by: Jeanne Mauriello <jeanne.mauriello@mainlib.org> 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=41902 --- Comment #13 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 197950 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197950&action=edit Bug 41902: Display additional biblio info on duplicate check When a duplicate record is suspected during cataloguing, query the AdditionalContents record_display category for the StaffDuplicateCheckPage location. If configured, process the content as a Template Toolkit template with the duplicate biblio object and display the rendered result in the duplicate warning. The TT context variable is 'biblio' (a Koha::Biblio object), so administrators can use expressions like: [% biblio.author %] ([% biblio.copyrightdate %]) Content is scrubbed using the record_display scrubber for XSS safety. Signed-off-by: Jeanne Mauriello <jeanne.mauriello@mainlib.org> 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=41902 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=41902 --- Comment #14 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=41902 Jacob O'Mara <jacob.omara@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Needs documenting --- Comment #15 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- This will not be backported to 25.11.x due to it being deemed an enhancement or a dependancy not being met -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org