Two templates that I'm concerned with, though there may be others that could use
this treatment: biblio.record_entry.email and biblio.record_entry.print
Basically, they can group events from the same user and consolidate bibs, but as
they loop through the bibs they're not clearing the temporary variable that
contains the bib title, so we get duplicated and run-on titles in the output.
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
Conflicts:
Open-ILS/src/sql/Pg/002.schema.config.sql
From: [%- params.sender_email || default_sender %]
Subject: Bibliographic Records
-[% FOR cbreb IN target %]
+[% FOR cbreb IN target %][% title = '' %]
[% FOR item IN cbreb.items;
bre_id = item.target_biblio_record_entry;
<div>
<style> li { padding: 8px; margin 5px; }</style>
<ol>
- [% FOR cbreb IN target %]
+ [% FOR cbreb IN target %][% title = '' %]
[% FOR item IN cbreb.items;
bre_id = item.target_biblio_record_entry;
--- /dev/null
+-- Evergreen DB patch XXXX.data.bre_format.sql
+--
+-- Fix some templates that loop over bibs to not have duplicated/run-on titles
+--
+BEGIN;
+
+-- check whether patch can be applied
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+-- I think we shy away from modifying templates on existing systems, but this seems pretty safe...
+UPDATE
+ action_trigger.event_definition
+SET
+ template = replace(template,'[% FOR cbreb IN target %]','[% FOR cbreb IN target %][% title = '''' %]')
+WHERE
+ id IN (31,32);
+
+COMMIT;