Bug 28616 - Remove Data::Printer dependency
Summary: Remove Data::Printer dependency
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Packaging (show other bugs)
Version: master
Hardware: All All
: P5 - low critical (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
Depends on: 28220
  Show dependency treegraph
Reported: 2021-06-23 02:27 UTC by Mason James
Modified: 2021-07-22 06:19 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Text to go in the release notes:
Version(s) released in:

Bug 28616: Add libdata-printer-perl package (893 bytes, patch)
2021-06-23 02:30 UTC, Mason James
Details | Diff | Splinter Review
Bug 28616: (bug 28220 follow-up) Replace Data::Printer with simple warn (1.45 KB, patch)
2021-06-23 07:41 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Mason James 2021-06-23 02:27:10 UTC
On 23/06/21 4:14 am, Michael Kuhn wrote:
> Hi Himanshu
> > image.png
> > This is the error i am getting when I click on import Patrons module.
> > Koha version is 21.05. this is the reason I asked.
> Error 500 is a very unspecific HTTP message that can have many different reasons. You will have to search for the reason in the log files.
> However, this error has nothing to do with the (meanwhile solved) problem described in my posting "[Koha] Reoccurring DBMS auto increment issue".
> Just for your information: I just checked in my own demo installation ( http://koha.adminkuhn.ch:8080 ) which uses Koha 21.05 - it also gives me Error 500 when clicking Koha menu "Tools > Import patrons". In my case log file "plack-error.log" shows the following:
> Could not compile /usr/share/koha/intranet/cgi-bin/tools/import_borrowers.pl: Can't locate Data/Printer.pm in @INC (you may need to install the Data::Printer module) (@INC contains: /usr/share/koha/lib /usr/share/koha/installer /usr/share/koha/lib/installer /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base /var/lib/koha/sandkasten/plugins) at /usr/share/koha/lib/Koha/Patrons/Import.pm line 352.
> BEGIN failed--compilation aborted at /usr/share/koha/lib/Koha/Patrons/Import.pm line 352.
> Compilation failed in require at /usr/share/koha/intranet/cgi-bin/tools/import_borrowers.pl line 50.
> BEGIN failed--compilation aborted at /usr/share/koha/intranet/cgi-bin/tools/import_borrowers.pl line 50.
> Maybe this is just a new bug you found.
> Best wishes: Michael

hi Michael ,
this does seem to be a bug in 21.05 (at least)

the following command should fix the problem, if the libdata-printer-perl package is not installed

  $ sudo apt install libdata-printer-perl
Comment 1 Mason James 2021-06-23 02:30:20 UTC
Created attachment 122308 [details] [review]
Bug 28616: Add libdata-printer-perl package

to test...
 1/ run  /intranet/cgi-bin/tools/import_borrowers.pl, get error
 2/ add patch, build package, install package
 3/ run  /intranet/cgi-bin/tools/import_borrowers.pl, get no error
Comment 2 Katrin Fischer 2021-06-23 07:39:02 UTC
Is there a chance to still get this in .01?
Comment 3 Jonathan Druart 2021-06-23 07:41:49 UTC
Created attachment 122310 [details] [review]
Bug 28616: (bug 28220 follow-up) Replace Data::Printer with simple warn

$_ is an exception that will be stringify in scalar context. We don't
need Data::Printer here.
Comment 4 Jonathan Druart 2021-06-23 08:04:59 UTC
Pushed to master for 21.11.00
Comment 5 Jonathan Druart 2021-06-24 07:38:40 UTC
Added a QA test for Data::Printer - https://gitlab.com/koha-community/qa-test-tools/-/merge_requests/39
Comment 6 Kyle M Hall 2021-06-24 14:04:57 UTC
Pushed to 21.05.x for 20.05.01
Comment 7 Fridolin Somers 2021-07-10 01:27:06 UTC
For 20.11 waiting for Bug 28220
Comment 8 Katrin Fischer 2021-07-10 22:14:06 UTC
(In reply to Fridolin Somers from comment #7)
> For 20.11 waiting for Bug 28220

Hi Frido, was this pushed to 20.11.x now?