[Koha-bugs] [Bug 32442] Invalid Template Toolkit in notices can cause errors

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Jan 31 14:09:45 CET 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32442

--- Comment #15 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
Created attachment 145863
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145863&action=edit
Bug 32442: (bug 28739 follow-up) Ensure txn is rollbacked

If the TT process call is returning false and so the croak is raised,
then the txn is not rollbacked and the txn is not commited either.

We need to ensure the txn will be correctly rollbacked.

Test plan:
1. Go to any notice and create some invalid Template Toolkit:

[% IF ( 1 == 1 %]
test
[% END %]

2. Save and continue

3. Logout of Koha and attempt to log back in
=> Without this patch you got
Transaction aborted: DBIx::Class::Storage::DBI::mysql::_exec_svp_release(): DBI
Exception: DBD::mysql::db do failed: SAVEPOINT savepoint_4 does not exist at
/kohadevbox/koha/Koha/Object.pm line 170
. Rollback failed: DBIx::Class::Storage::DBI::mysql::_exec_svp_rollback(): DBI
Exception: DBD::mysql::db do failed: SAVEPOINT savepoint_3 does not exist at
/kohadevbox/koha/Koha/Patron.pm line 363 at /kohadevbox/koha/Koha/Patron.pm
line 363
 at /usr/share/perl5/DBIx/Class/Exception.pm line 77
=> With this patch applied the login works successfully

QA Note: The test is not testing that the txn is rolledback, I didn't
manage to test that.

Signed-off-by: Nick Clemens <nick at bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list