MarcusBarnes / mik

The Move to Islandora Kit is an extensible PHP command-line tool for converting source content and metadata into packages suitable for importing into Islandora (or other digital repository and preservations systems).
GNU General Public License v3.0
34 stars 11 forks source link

CdmSingleFile: Blank "input_directories" creates ambiguous error #483

Closed bondjimbond closed 5 years ago

bondjimbond commented 5 years ago

According to the wiki, if you want the OBJ datastream for a given file, you should "Comment out, remove, or use an empty value for input_directories".

If you use an empty value, it fails to download the objects. Instead you get ambiguous errors:

[2018-08-28 14:25:56] ErrorException.ERROR: ErrorException {"message":"Invalid argument supplied for foreach()","code":{"pointer":657},"severity":2,"file":"/Users/brandon/sfuvault/mik/src/filegetters/CdmSingleFile.php","line":147} [] [2018-08-28 14:25:56] ErrorException.ERROR: ErrorException {"message":"problem writing package","record_key":657,"details":"[object] (mik\exceptions\MikErrorException(code: 0): at /Users/brandon/sfuvault/mik/mik:105)"} []

Commenting out the line entirely works.

Leaving it empty DOESS work for the CdmCompound toolchain, but not CdmSingleFile.

Simple solution would be to change the instructions in the wiki, but a better solution (keeping functionality consistent between toolchains) would be to make sure that a blank value has the expected result.

mjordan commented 5 years ago

I vote for changing the wiki. I'm reluctant to change any code since I don't have a CONTENTdm instance to test against...

bondjimbond commented 5 years ago

Changing the wiki sounds good to me. I'll take care of it.