From d1b26132d994985617cef6485205ff156941f7e4 Mon Sep 17 00:00:00 2001 From: Jordan Dukart Date: Wed, 25 Sep 2013 14:43:40 +0000 Subject: [PATCH] Check to see if function exists before calling it. --- includes/derivatives.inc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/includes/derivatives.inc b/includes/derivatives.inc index c66944b1..8a6627e5 100644 --- a/includes/derivatives.inc +++ b/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); } } }