diff --git a/webform.module b/webform.module index dab4f2e0e..d6c8e8dc1 100644 --- a/webform.module +++ b/webform.module @@ -4885,7 +4885,8 @@ function _webform_components_tree_sort($tree) { * Get a list of all available component definitions. */ function webform_components($include_disabled = FALSE, $reset = FALSE) { - static $components, $enabled; + $components = &drupal_static(__FUNCTION__ . '.components', NULL); + $enabled = &drupal_static(__FUNCTION__ . '.enabled', NULL); if (!isset($components) || $reset) { $components = array(); @@ -4932,6 +4933,7 @@ function webform_component_include($component_type) { // No need to load components that have already been added once. if (!isset($included[$component_type])) { $components = webform_components(TRUE); + echo "Component info {$component_type} … " . (isset($components[$component_type]) ? "found" : "not found") . ".\n"; $included[$component_type] = TRUE; if (isset($components[$component_type]['file'])) { @@ -4939,6 +4941,7 @@ function webform_component_include($component_type) { $pathinfo = pathinfo($info['file']); $basename = basename($pathinfo['basename'], '.' . $pathinfo['extension']); $path = (!empty($pathinfo['dirname']) ? $pathinfo['dirname'] . '/' : '') . $basename; + echo "Including {$info['module']}/{$path}.{$pathinfo['extension']}\n"; module_load_include($pathinfo['extension'], $info['module'], $path); } } @@ -4963,9 +4966,12 @@ function webform_component_invoke($type, $callback) { $callback = array_shift($args); $function = '_webform_' . $callback . '_' . $type; webform_component_include($type); + echo "Calling $function …"; if (function_exists($function)) { + echo " found.\n"; return call_user_func_array($function, $args); } + echo " not found.\n"; } /**