Bug 25247: Only convert data ot objects when displaying on screen
authorNick Clemens <nick@bywatersolutions.com>
Wed, 22 Apr 2020 12:11:53 +0000 (12:11 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 4 May 2020 07:48:18 +0000 (08:48 +0100)
To test:
 1 - Modify a patron
 2 - Circulate some items to the patron
 3 - Click 'Modification log'
 4 - Verify you see your actions
 5 - Under 'Output' select 'To a file'
 6 - Save the output to a file
 7 - View the file
 8 - Not you have references ot objects in stead of patron/item data
 9 - Apply patch
10 - Repeat
11 - Note viewing on screen has not changed
12 - Note exporting to file inlcudes borrower/item numbers and not references
13 - Sign off

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

tools/viewlog.pl

index e6630cf..2ccd472 100755 (executable)
@@ -174,7 +174,7 @@ if ($do_it) {
         #always add firstname and surname for librarian/user
         if ( $log->user ) {
             my $patron = Koha::Patrons->find( $log->user );
-            if ($patron) {
+            if ($patron && $output eq 'screen') {
                 $result->{librarian} = $patron;
             }
         }
@@ -183,7 +183,7 @@ if ($do_it) {
         if ( $log->module eq "CIRCULATION" || $log->module eq "MEMBERS" || $log->module eq "FINES" ) {
             if ( $log->object ) {
                 my $patron = Koha::Patrons->find( $log->object );
-                if ($patron) {
+                if ($patron && $output eq 'screen') {
                     $result->{patron} = $patron;
                 }
             }