diff --git a/devel_themer.module b/devel_themer.module index d06b5b88dc2d6dad23edc98ca29d382bf05b1161..06b287d938390e05c5c85fd040969475a57d1c0f 100644 --- a/devel_themer.module +++ b/devel_themer.module @@ -378,7 +378,18 @@ function devel_themer_theme_twin() { $reflect = new ReflectionFunction($info['devel_function_intercept']); $params = $reflect->getParameters(); for ($i=0; $i < count($args); $i++) { - $meta['variables'][$params[$i]->getName()] = $args[$i]; + // The implementation of the theme function may recieve less parameters than were passed to it. + if ($i < count($params)) { + $meta['variables'][$params[$i]->getName()] = $args[$i]; + } + else { + // @TODO: Consider informing theme developers of theme functions that accept less parameters + // than are passed to them. This could be disabled by default, with an option to + // enable at admin/settings/devel_themer. Given this is a theme developer module + // used by implementors of theme override functions, it would probably be a useful + // default feature. + $meta['variables'][] = $args[$i]; + } } } else {