qadan / islandora_batch_derivative_trigger

Allows for the collection-wide generation or regeneration of derivatives and metadata.
GNU General Public License v3.0
8 stars 9 forks source link

AbstractObject collection cannot be None #10

Open GarrettArm opened 7 years ago

GarrettArm commented 7 years ago

In includes/batch.inc, there is:

function islandora_batch_derivative_trigger_regenerate_metadata_batch($children, $mapping, AbstractObject $collection, $content_model)

the third argument is specified as an AbstractObject type. however, when doing by specific pids, the collection argument == None. It fails due to the AbstractObject requirement.

drush --user=admin dcmd-regen --pids=mycollection:pid,mycollection:pid --mapping=mods_to_dc.xslt:MODS

removing the AbstractObject static typing allows the same drush command to succeed. there may be a safer/better way to approach this problem, but this does work:

function islandora_batch_derivative_trigger_regenerate_metadata_batch($children, $mapping, $collection, $content_model)

GarrettArm commented 7 years ago

@qadan

specifically, line 170 in islandora_batch_derivative_trigger.drush.inc passes NULL to line 253 in /includes/batch.inc -- when line 253 requires that argument be of type AbstractObject.