Bug 8700 - RESERVESLIP fields not being replaced correctly
authorKyle M Hall <kyle@bywatersolutions.com>
Wed, 29 Aug 2012 12:44:26 +0000 (08:44 -0400)
committerPaul Poulain <paul.poulain@biblibre.com>
Wed, 10 Oct 2012 15:58:30 +0000 (17:58 +0200)
The slip RESERVESLIP is not replacing fields correctly.
C4::Reserves::ReserveSlip calls C4::Letters::GetPreparedLetter,
and passes the $reserve hashref to it for each table except branches
( which is passed the branchcode ). The problem is, if you pass a
hashref for a table, it uses that hashref for the replacing, rather
than looking up the data from the database.

Fixed by passing the correct keys for each of the tables requested.

Signed-off-by: Marc Veron <veron@veron.ch>
Tested following the test plan.
Could reproduce the bug.
After applying the patch slip printed as expected.

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

index 585d1e5..1dc6f72 100644 (file)
@@ -2081,9 +2081,9 @@ sub ReserveSlip {
         tables => {
             'reserves'    => $reserve,
             'branches'    => $reserve->{branchcode},
-            'borrowers'   => $reserve,
-            'biblio'      => $reserve,
-            'items'       => $reserve,
+            'borrowers'   => $reserve->{borrowernumber},
+            'biblio'      => $reserve->{biblionumber},
+            'items'       => $reserve->{itemnumber},
         },
     );
 }