Bug 15250: Fix Perl error on acqisition stats page
authorKatrin Fischer <Katrin.Fischer.83@web.de>
Wed, 25 Nov 2015 17:18:04 +0000 (18:18 +0100)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 4 Dec 2015 14:24:55 +0000 (14:24 +0000)
To test:
- Go to reports -> Acquisitions statistics
- Populate with the following values:

   Acquisitions statistics
      Received on.
         Row:    checked
         Column: checked
         From:   01/01/2015
         To:     Un-selected

    Cell value
       Count items

    Output: To screen into the browser: checked

- Running the report will trigger the following error:

   Software error:
   Can't locate object method "field" via package "aqorders.datereceived" (perhaps you forgot to load "aqorders.datereceived"?) at /usr/share/koha/intranet/cgi-bin/reports/acquisitions_stats.pl line 293.

- Apply the patch and repeat test
- Verify the report now works correctly

Note: Patch was created from notes and suggested
      fix on the bug report, written by Barton Chittenden.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
reports/acquisitions_stats.pl

index 58e3fd9..62895c6 100755 (executable)
@@ -284,7 +284,7 @@ sub calculate {
             } elsif ( $rodsp == 3 ) {
                 $field{$a} = "Year($a)";
             } else {
-                field{$a} = $a;
+                $field{$a} = $a;
             }
         }
         elsif ( $_ =~ /bookseller/ ) {