Bug 39210 - Don't dump objects in verbose output from import_patrons.pl
Summary: Don't dump objects in verbose output from import_patrons.pl
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low minor
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-27 13:19 UTC by Magnus Enger
Modified: 2025-02-27 13:19 UTC (History)
1 user (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Magnus Enger 2025-02-27 13:19:18 UTC
If you run import_patrons.pl with -v -v you mostly get informative output like this: 

Errors:
$VAR1 = [
          {
            'missing_criticals' => [
                                     {
                                       'surname' => 'Kjelsberg',
                                       'value' => 'PATRON',
                                       'lineraw' => '"123445","1234","MYKOHA","PATRON","Betzy","Kjelsberg",,"F","","","","","",,,,,,,,,,,,"",""
',
                                       'key' => 'categorycode',
                                       'borrowernumber' => 'UNDEF',
                                       'line' => 514,
                                       'category_map' => 1
                                     }
                                   ]
          },

But some of the output is Koha objects run through Dumper, and some of these are thousands of lines of output, about 32000 lines to be more exact. Not very useful. 

From the examples I am looking at it perhaps looks like this huge object dump happens only once per run, but I am not certain of that. 

To reproduce: 
- Create a patron CSV file that will result in errors, for example because the same cardnumber is used three times. 
- Import the file with import_patrons.pl:
  sudo koha-shell -c "perl /usr/share/koha/bin/import_patrons.pl --file patrons.csv --matchpoint cardnumber -v -v --confirm > /tmp/import-patrons.log" kohadev
- Look in /tmp/import-patrons.log and verify there is at least one huge object dump