[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
Fri Dec 16 15:51:00 CET 2022


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

--- Comment #8 from Nick Clemens <nick at bywatersolutions.com> ---
Created attachment 144687
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=144687&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>

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


More information about the Koha-bugs mailing list