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.