summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormoshe weitzman2008-12-08 03:23:49 (GMT)
committer moshe weitzman2008-12-08 03:23:49 (GMT)
commit8ce803aade6f7e705c1e2162218d278f42b310d1 (patch)
treeee2ac9b51a3a17651f56adb611cd7bbfd8848df3
parent0af0ae10cbf00587d1c90be16db4da01c5252125 (diff)
#340677 by Bevan. Fatal error: Call to getName() on non-object.
-rw-r--r--devel_themer.module13
1 files changed, 12 insertions, 1 deletions
diff --git a/devel_themer.module b/devel_themer.module
index d06b5b8..06b287d 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 {