Closed McFateM closed 6 years ago
OK, looking at the code I see the immediate problem... The hook implementation does return an array of derivative specs as prescribed, but it appears that an Abstract Object was added to the argument list for this function to support the islandora_oralhistories_make_vtt option, but requiring this argument is not compatible with the design of this hook function.
So I made two simple changes in the code and now it is working for me.
In islandora_oralhistories.module I changed lines 261-265 to read:
/**
* Implements hook_islandora_CMODEL_PID_derivative().
*/
function islandora_oralhistories_islandora_oralhistoriesCModel_islandora_derivative(
AbstractObject $object = NULL, $ds_modified_params = array()) {
This makes $object an optional argument so that the function works as intended when called by IMI.
I also changed line 299 to this:
if ($object && variable_get('islandora_oralhistories_vtt_index_ds_generation', TRUE)) {
This way, the function doesn't blow up when it is called without an $object.
Thanks @McFateM. Would you be able to do some more testing and then create a pull-request? I'll schedule some time to review and test.
I can certainly do more testing since I need to ingest a few dozen OH objects this week. Not sure about the pull-request... I made these little changes on the fly and am honestly not sure my codebase is in a state that would allow me to properly pull against your Github repo. I'm affraid there might be lots of unrelated merge conflicts to deal with due to other changes I have experimented with.
@McFateM OK. I'll still schedule some time and maybe reach out to you if I need more information on the suggested changes. Thanks again for using the module and testing against the multi-importer. FYI, there is an older issue https://github.com/Islandora-Labs/islandora_solution_pack_oralhistories/issues/1 that may be related to this (if only in terms of batch functionality).
For review and inclusion in release.
Addressed in pull-request #128 (merged with commit ca77d27).
I'm trying to do some mass ingest of oral histories using the Islandora Multi-Importer (IMI) module and keep running into this problem. At one point the IMI tries to call islandora_oralhistories_islandora_oralhistoriesCModel_islandora_derivative, which is defined in the .module file, but this hook is to be called with NO arguments, and it only returns an array of derivative specs. In the IOH module this function requires an Abstract Object argument and it actually performs the derivative creation.
Compare the following from the basic image solution pack, to the same hook function from IOH...