Bug 7093: placeholds for suggestion table not working in notices
authorIan Walls <ian.walls@bywatersolutions.com>
Wed, 7 Dec 2011 16:43:20 +0000 (11:43 -0500)
committerPaul Poulain <paul.poulain@biblibre.com>
Tue, 13 Dec 2011 15:49:54 +0000 (16:49 +0100)
In parseletter_sth, the suggestions table was defined twice.  The first time (which
is the only definition to get called, as it matches first then exists), defined the
primary search keys as borrowernumber and biblionumber.  This is incorrect; the only
usage of the suggestions table tokens is with suggestionid as the key.  This is defined
further down the if/then chain.

This patch removes the erroneous sth query definition.

To test:

1.  Place a suggestion with a patron account with a configured email you can access
2.  Approve or reject it
3.  Verify the message you receive contains suggestion tokens (like title, author and reason)

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Suggestion mails for accepted, rejected and ordered look good now.
I couldn't test the suggestion mail AVAILABLE (bug 7096), but
assuming this would work too.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
C4/Letters.pm

index 6846a00..862121c 100644 (file)
@@ -490,7 +490,6 @@ sub parseletter_sth {
     ($table eq 'biblioitems'  ) ? "SELECT * FROM $table WHERE   biblionumber = ?"                      :
     ($table eq 'items'        ) ? "SELECT * FROM $table WHERE     itemnumber = ?"                      :
     ($table eq 'issues'       ) ? "SELECT * FROM $table WHERE     itemnumber = ?"                      :
-    ($table eq 'suggestions'  ) ? "SELECT * FROM $table WHERE borrowernumber = ? and biblionumber = ?" :
     ($table eq 'reserves'     ) ? "SELECT * FROM $table WHERE borrowernumber = ? and biblionumber = ?" :
     ($table eq 'borrowers'    ) ? "SELECT * FROM $table WHERE borrowernumber = ?"                      :
     ($table eq 'branches'     ) ? "SELECT * FROM $table WHERE     branchcode = ?"                      :