Browse Source

Check to see if function exists before calling it.

pull/410/head
Jordan Dukart 11 years ago
parent
commit
d1b26132d9
  1. 5
      includes/derivatives.inc

5
includes/derivatives.inc

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

Loading…
Cancel
Save