diff -upr ./includes/common.inc ../drupal5/includes/common.inc --- ./includes/common.inc 2009-09-16 13:29:09.000000000 -0400 +++ ../drupal5/includes/common.inc 2009-11-16 10:55:00.000000000 -0500 @@ -25,6 +25,13 @@ define('SAVED_UPDATED', 2); define('SAVED_DELETED', 3); /** + * Create E_DEPRECATED constant for older PHP versions (<5.3). + */ +if (!defined('E_DEPRECATED')) { + define('E_DEPRECATED', 8192); +} + +/** * Set content for a specified region. * * @param $region @@ -578,7 +585,7 @@ function error_handler($errno, $message, return; } - if ($errno & (E_ALL ^ E_NOTICE)) { + if ($errno & (E_ALL & ~E_NOTICE & ~E_DEPRECATED)) { $types = array(1 => 'error', 2 => 'warning', 4 => 'parse error', 8 => 'notice', 16 => 'core error', 32 => 'core warning', 64 => 'compile error', 128 => 'compile warning', 256 => 'user error', 512 => 'user warning', 1024 => 'user notice', 2048 => 'strict warning', 4096 => 'recoverable fatal error'); $entry = $types[$errno] .': '. $message .' in '. $filename .' on line '. $line .'.'; diff -upr ./includes/module.inc ../drupal5/includes/module.inc --- ./includes/module.inc 2007-07-20 20:54:18.000000000 -0400 +++ ../drupal5/includes/module.inc 2009-11-16 20:14:38.000000000 -0500 @@ -379,13 +379,17 @@ function module_implements($hook, $sort */ function module_invoke() { $args = func_get_args(); - $module = array_shift($args); - $hook = array_shift($args); + $module = $args[0]; + $hook = $args[1]; + unset($args[0], $args[1]); $function = $module .'_'. $hook; + if ($function == 'profile_load_profile') + watchdog('test', t('module_invoke invoked by %module.', array('%module' => $module))); if (module_hook($module, $hook)) { return call_user_func_array($function, $args); } } + /** * Invoke a hook in all enabled modules that implement it. * diff -upr ./modules/comment/comment.info ../drupal5/modules/comment/comment.info --- ./modules/comment/comment.info 2009-09-16 20:08:42.000000000 -0400 +++ ../drupal5/modules/comment/comment.info 2009-11-16 12:16:57.000000000 -0500 @@ -1,6 +1,6 @@ ; $Id: comment.info,v 1.3 2006/11/21 20:55:34 dries Exp $ name = Comment -description = Allows users to comment on and discuss published content. +description = "Allows users to comment on and discuss published content." package = Core - optional version = VERSION diff -upr ./modules/drupal/drupal.info ../drupal5/modules/drupal/drupal.info --- ./modules/drupal/drupal.info 2009-09-16 20:08:42.000000000 -0400 +++ ../drupal5/modules/drupal/drupal.info 2009-11-16 12:25:48.000000000 -0500 @@ -1,6 +1,6 @@ ; $Id: drupal.info,v 1.3 2006/11/21 20:55:34 dries Exp $ name = Drupal -description = Lets you register your site with a central server and improve ranking of Drupal projects by posting information on your installed modules and themes; also enables users to log in using a Drupal ID. +description = "Lets you register your site with a central server and improve ranking of Drupal projects by posting information on your installed modules and themes; also enables users to log in using a Drupal ID." package = Core - optional version = VERSION diff -upr ./modules/node/node.info ../drupal5/modules/node/node.info --- ./modules/node/node.info 2009-09-16 20:08:42.000000000 -0400 +++ ../drupal5/modules/node/node.info 2009-11-16 12:20:21.000000000 -0500 @@ -1,6 +1,6 @@ ; $Id: node.info,v 1.3 2006/11/21 20:55:34 dries Exp $ name = Node -description = Allows content to be submitted to the site and displayed on pages. +description = "Allows content to be submitted to the site and displayed on pages." package = Core - required version = VERSION diff -upr ./modules/poll/poll.info ../drupal5/modules/poll/poll.info --- ./modules/poll/poll.info 2009-09-16 20:08:42.000000000 -0400 +++ ../drupal5/modules/poll/poll.info 2009-11-16 12:20:55.000000000 -0500 @@ -1,6 +1,6 @@ ; $Id: poll.info,v 1.3 2006/11/21 20:55:35 dries Exp $ name = Poll -description = Allows your site to capture votes on different topics in the form of multiple choice questions. +description = "Allows your site to capture votes on different topics in the form of multiple choice questions." package = Core - optional version = VERSION diff -upr ./modules/system/system.module ../drupal5/modules/system/system.module --- ./modules/system/system.module 2009-09-16 16:03:53.000000000 -0400 +++ ../drupal5/modules/system/system.module 2009-11-16 14:33:19.000000000 -0500 @@ -1864,7 +1864,7 @@ function _system_sort_requirements($a, $ /** * Theme status report */ -function theme_status_report(&$requirements) { +function theme_status_report($requirements) { $i = 0; $output = ''; foreach ($requirements as $requirement) { diff -upr ./modules/upload/upload.module ../drupal5/modules/upload/upload.module --- ./modules/upload/upload.module 2008-10-08 16:10:26.000000000 -0400 +++ ../drupal5/modules/upload/upload.module 2009-11-16 21:00:03.000000000 -0500 @@ -814,7 +814,7 @@ function _upload_form($node) { /** * Theme the attachments list. */ -function theme_upload_form_current(&$form) { +function theme_upload_form_current($form) { $header = array(t('Delete'), t('List'), t('Description'), t('Size')); foreach (element_children($form) as $key) { diff -upr ./modules/user/user.module ../drupal5/modules/user/user.module --- ./modules/user/user.module 2009-09-16 15:33:40.000000000 -0400 +++ ../drupal5/modules/user/user.module 2009-11-16 19:47:32.000000000 -0500 @@ -1043,7 +1043,9 @@ function user_logout() { // Destroy the current session: session_destroy(); - module_invoke_all('user', 'logout', NULL, $user); + // Only variables can be passed by reference workaround. + $null = NULL; + user_module_invoke('logout', $null, $user); // Load the anonymous user $user = drupal_anonymous_user(); @@ -1505,7 +1507,7 @@ function user_delete($edit, $uid) { $array = array('%name' => $account->name, '%email' => '<'. $account->mail .'>'); watchdog('user', t('Deleted user: %name %email.', $array), WATCHDOG_NOTICE); drupal_set_message(t('%name has been deleted.', $array)); - module_invoke_all('user', 'delete', $edit, $account); + user_module_invoke('delete', $edit, $account); } function user_edit_validate($form_id, $form_values) { @@ -1545,8 +1547,11 @@ function user_view($uid = 0) { } // Retrieve and merge all profile fields: $fields = array(); + $null = NULL; foreach (module_list() as $module) { - if ($data = module_invoke($module, 'user', 'view', '', $account)) { + $function = $module .'_user'; + // $null and $account need to be passed by reference. + if (function_exists($function) && ($data = $function('view', $null, $account, ''))) { foreach ($data as $category => $items) { foreach ($items as $key => $item) { $item['class'] = "$module-". $item['class']; @@ -1556,6 +1561,7 @@ function user_view($uid = 0) { } } + // Let modules change the returned fields - useful for personal privacy // controls. Since modules communicate changes by reference, we cannot use // module_invoke_all(). @@ -2456,8 +2462,12 @@ function user_help_page() { function _user_categories($account) { $categories = array(); + // Only variables can be passed by reference workaround. + $null = NULL; foreach (module_list() as $module) { - if ($data = module_invoke($module, 'user', 'categories', NULL, $account, '')) { + $function = $module .'_user'; + // $null and $account need to be passed by reference. + if (function_exists($function) && ($data = $function('categories', $null, $account, ''))) { $categories = array_merge($data, $categories); } } @@ -2479,7 +2489,9 @@ function _user_sort($a, $b) { function _user_forms(&$edit, $account, $category, $hook = 'form') { $groups = array(); foreach (module_list() as $module) { - if ($data = module_invoke($module, 'user', $hook, $edit, $account, $category)) { + $function = $module .'_user'; + // $edit and $account need to be passed by reference. + if (function_exists($function) && ($data = $function($hook, $edit, $account, $category))) { $groups = array_merge_recursive($data, $groups); } }