Bug 27707: (bug 26639 follow-up) Fix renewals when RenewalSendNotice is set
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 16 Feb 2021 08:06:03 +0000 (09:06 +0100)
committerVictor Grousset/tuxayo <victor@tuxayo.net>
Tue, 23 Feb 2021 21:32:38 +0000 (22:32 +0100)
commitc0c32cc43d29ad413abda1ba52c202543ae28946
treedcfc56ba9c7bff98b9de68dd548e3b9b45810362
parent0a31d4e23ac5655de79f69b685ae6e5ee456d1ec
Bug 27707: (bug 26639 follow-up) Fix renewals when RenewalSendNotice is set

Since bug 26639 we have auto savepoint enabled and the LOCK TABLE query
in C4::Circulation::SendCirculationAlert is not correctly handled.
From the MySQL doc that is copied few lines before, "LOCK TABLE will
commit any transactions", but here we don't have a savepoint and the
release for a non-existent savepoint will throw a DBI exception.

This patch removes the unecessary transaction and prevent the following
error when a renewal is done:
> DBIx::Class::Storage::DBI::mysql::_exec_svp_release(): DBI Exception: DBD::mysql::db do failed: SAVEPOINT savepoint_0 does not exist [for Statement "RELEASE SAVEPOINT savepoint_0"] at /usr/share/koha/lib/C4/Circulation.pm line 3590

Test plan:
1. Enable RenewalSendNotice
2. Add some email address to patron and select the email box from the message preference "Item checkout and renewal" in order to receive renewal emails.
3. Check 1 item out to a patron
4. Renew it

Signed-off-by: Andrew Nugged <nugged@gmail.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 76c38d10d06dfcc377ab82cd312b12b8457a2dc8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d641561125d861236157d8b6f7edc6870a96a866)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit e7d9ef4116657ecc8e1b6dfcdac713f60d3e6474)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
C4/Circulation.pm