Bug 17693 - Add option to export deleted bibs in export_records.pl
Summary: Add option to export deleted bibs in export_records.pl
Status: RESOLVED DUPLICATE of bug 20551
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Theodoros Theodoropoulos
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-29 10:00 UTC by Theodoros Theodoropoulos
Modified: 2020-04-16 10:30 UTC (History)
2 users (show)

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


Attachments
Add option to export deleted bibs in export_records.pl (5.02 KB, patch)
2016-11-29 14:18 UTC, Theodoros Theodoropoulos
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Theodoros Theodoropoulos 2016-11-29 10:00:05 UTC
Currently the export_records.pl script has an option to export a list of deleted items, but not deleted biblios.

There are cases where such an export would seem useful (at Aristotle University of Thessaloniki we have been using it for a long time), the data is already kept in the deletedbiblio table, so the enhancement is easy to implement as it only requires a couple lines of code in the export script.
Comment 1 Theodoros Theodoropoulos 2016-11-29 14:18:54 UTC
Created attachment 57807 [details] [review]
Add option to export deleted bibs in export_records.pl

This commit adds an additional option to the export_records.pl
script, so that users will be able to get a line-seperated
list of biblionumbers with records deleted (optionally after
a specified date).

Test plan:
1/ Apply patch
2/ delete one or more marc records from Koha
3/ from within the ./misc/ folder run:
   export_records.pl --deleted_bibs --record-type='bibs'
   You should get a Koha.mrc file with the deleted biblionumbers
   (one per line).
4/ you may also use '--date' option like so:
   export_records.pl --deleted_bibs --record-type='bibs' --date="YYYY-MM-DD"
   This way you should get a filtered list of biblionumbers that were deleted
   AFTER the specified date.
Comment 2 Theodoros Theodoropoulos 2016-11-29 14:32:04 UTC
ps1. My coding style is not so elegant, but I decided to use an approach that makes the least possible changes to the original file. Comments and suggestions for different approaches are welcome.

ps2. The patch is not applicable to pre-3.22 Koha versions as-is (because the export script was significantly different), but if required I could provide a backfix (ie for v3.20)
Comment 3 Owen Leonard 2017-04-11 13:31:43 UTC
If the only option for retrieving deleted records is to get a text file with one biblionumber per line I don't think it should save a file with the ".mrc" extension. That makes it look like it's a MARC file.
Comment 4 Jonathan Druart 2020-04-16 10:30:50 UTC

*** This bug has been marked as a duplicate of bug 20551 ***