Browse Source

Merge pull request #410 from jordandukart/7.x-derivative-failsafe

Check to see if function exists before calling it.
pull/403/merge
Mitch MacKenzie 11 years ago
parent
commit
bfd6c39be7
  1. 11
      includes/derivatives.inc

11
includes/derivatives.inc

@ -60,9 +60,14 @@ function islandora_do_derivatives(AbstractObject $object, array $options) {
require_once $hook['file'];
}
foreach ($hook['function'] as $function) {
$logging = call_user_func($function, $object, $options['force']);
if (!empty($logging)) {
$results[] = $logging;
if (function_exists($function)) {
$logging = call_user_func($function, $object, $options['force']);
if (!empty($logging)) {
$results[] = $logging;
}
}
else {
watchdog('islandora', 'Unable to call derivative function @function as it was not found!', array('@function' => $function), WATCHDOG_ERROR);
}
}
}

Loading…
Cancel
Save