ulsdevteam / islandora_datastreams_io

Islandora Datastreams Import / Export Utility
GNU General Public License v2.0
5 stars 4 forks source link

Import datastreams still ignores namespace restrictions #5

Closed bondjimbond closed 6 years ago

bondjimbond commented 6 years ago

If you import a zip file of object datastreams, objects in restricted namespaces will not be listed in the import confirmation screen. However, if you proceed with the import, the datastreams contained in that zip file are still pushed.

i.e. in my Vagrant machine, I have three Citation objects: citations:1, citations:2, and tweepy:1. I set up namespace restrictions so that "tweepy" is not allowed.

I zip up a file of MODS datastrams for citations:1, citations:2, and tweepy:1. Import them via this tool.

The import screen lists the two objects in the "citations" namespace, and ignores the one from the "tweepy" namespace. Click "finish" to import.

Disable namespace restrictions and check on tweepy:1. Its MODS record contains the changes from that ZIP file.

I suspect the extracted files are all getting processed, regardless of the initial check that was made.

wgilling commented 6 years ago

Important catch ... the files were supposed to be removed from the temp directory as they fail the islandora_namespace_accessible call, but the full path was not used into the temp folder, so they were not being deleted. With the latest update f2e2bf4d55b3d932db396df00840f25e06c08fe3, this should now be working. I also added the count of actual files vs. "count that would be imported" to the output for the first screen of the import.

bondjimbond commented 6 years ago

It works! Thanks for working on the namespace issue. A web wrapper for islandora_datastream_crud is a great tool to have, but we couldn't deploy it without namespace restrictions.