Bug 26935: Don't use basket for claimacquisition and claimissues
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 5 Nov 2020 08:12:12 +0000 (09:12 +0100)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 5 Nov 2020 14:24:20 +0000 (15:24 +0100)
commitcb3753d29254cb2f17661a36ddece56919ba980d
tree588ba46e1d9745dfacef3fe7a2d37412e8e75940
parenta10db1347dfbe5a444e669e363aab9b635d74069
Bug 26935: Don't use basket for claimacquisition and claimissues

Incorrect basketid is sent for claimacquisition and claimissues.

The basket info are not used in the default template of these notices, but if it
is used, a wrong basket may be passed to generate the notice.

This has been caught by a test failure after bug 26745.

 #   Failed test 'SendAlerts - claimissue'
 #   at t/db_dependent/Letters.t line 642.
 C4::Letters::_substitute_tables(): DBI Exception: DBD::mysql::st execute failed: called with 2 bind variables when 1 are needed [for Statement "SELECT * FROM aqbasket WHERE       basketno = ?" with ParamValues: 0=53] at /kohadevbox/koha/C4/Letters.pm line 679

This is a quick patch to fix the failing test, but more work would needed.

We are removing the basket info from those 2 notices and keeping it only
for orderacquisition.

Technically: the $externalid is coming from the parameter list of
SendAlerts, but it is a basketno only for orderacquisition. We must not
pass it for other notices.

Test plan:
Confirm that the failing test is now passing and that the changes make
sense.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
C4/Letters.pm