From 607e9626d5af265b18e8319b156bb0fda3445cd4 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 3 Feb 2009 17:30:13 +0000 Subject: - Patch #361683by Barry, Yves, Karen, Moshe Weitzman, David Strauss, floriant, chx, David Rothstein: initial field API patch. More work to be done, but ... oh my! --- includes/install.inc | 6 ++++-- includes/theme.inc | 10 ++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'includes') diff --git a/includes/install.inc b/includes/install.inc index 959e4e006..f2721aa1d 100644 --- a/includes/install.inc +++ b/includes/install.inc @@ -490,8 +490,10 @@ function drupal_verify_profile($profile, $locale) { * * @param $module_list * The modules to install. + * @param $disable_modules_installed_hook + * Normally just testing wants to set this to TRUE. */ -function drupal_install_modules($module_list = array()) { +function drupal_install_modules($module_list = array(), $disable_modules_installed_hook = FALSE) { $files = module_rebuild_cache(); $module_list = array_flip(array_values($module_list)); do { @@ -511,7 +513,7 @@ function drupal_install_modules($module_list = array()) { asort($module_list); $module_list = array_keys($module_list); $modules_installed = array_filter($module_list, '_drupal_install_module'); - if (!empty($modules_installed)) { + if (!$disable_modules_installed_hook && !empty($modules_installed)) { module_invoke_all('modules_installed', $modules_installed); } module_enable($module_list); diff --git a/includes/theme.inc b/includes/theme.inc index b77e35854..57989cc5b 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -624,7 +624,9 @@ function theme() { } if (isset($info['function'])) { // The theme call is a function. - $output = call_user_func_array($info['function'], $args); + if (drupal_function_exists($info['function'])) { + $output = call_user_func_array($info['function'], $args); + } } else { // The theme call is a template. @@ -2004,7 +2006,11 @@ function template_preprocess_node(&$variables) { } // Clean up name so there are no underscores. $variables['template_files'][] = 'node-' . str_replace('_', '-', $node->type); - $variables['template_files'][] = 'node-' . $node->nid; + $variables['template_files'][] = 'node-' . $node->nid; + + // Add $FIELD_NAME_rendered variables for fields. + drupal_function_exists('field_attach_preprocess'); + $variables += field_attach_preprocess('node', $node); } /** -- cgit v1.2.3