mjordan / islandora_bulk_delete

A utility module that does one thing: deletes all the objects in an Islandora collection (or optionally, all issues and pages in a newspaper object). Use this tool carefully. It is dangerous.
GNU General Public License v3.0
7 stars 4 forks source link

Children deleted when target objects supplied in PID list file #6

Open TristanSmithlib opened 4 years ago

TristanSmithlib commented 4 years ago

(Hi Mark!) I had assumed that islandora_bulk_delete would only delete those objects supplied in the PID file when using the --pid_file options. This was in part informed by the text in the README which says that if I use the --list option in tandem with --pid_file it "will just list the PIDs named." However when I use the --pid_file option it goes ahead and deletes the children too. And when I use the --list option it lists not only the items in the PID file but also their children.

My preference is that this tool would only delete exclusively those items on the PID list. Alternatively maybe there could be a new switch which effects both pid file and non-pid-file behavior that determines whether children are deleted? But at any rate, if the current behavior stands, can we at minimum update the README to state that in fact it will delete the children too when using the --pid_file option?

A little background on the preference: As a repository admin I want to delete only those items on a pid list so that I can show a manifest of all of the PIDs that will be deleted in a reliably deterministic process to my stakeholders and repository co-maintainers. In other words we would like to have a workflow where the list of objects to be deleted goes through a vetting process with an audit trail. This way we can agree to what is going to be deleted, and then verify that the intended objects were in fact deleted and no fewer and no more. If the system automatically "helps" by deleting children then it's harder to do this. This is further complicated if I assume correctly that islandora_bulk_delete won't delete children of compound objects or other non-newspaper/book objects.

Thanks for all your work on this (and the many other things you do)!

Tristan

mjordan commented 4 years ago

Hi Tristan, sorry about the misunderstanding. I think all we need to do is add some logic at https://github.com/mjordan/islandora_bulk_delete/blob/7.x/islandora_bulk_delete.drush.inc#L169 that would check for the presence of a a new option --skip_descendants or something, which, if present in the drush command, would tell the command to not add descendant PIDs to the list of ones to delete. Does that sound like a viable solution to what you're looking for?