Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.756.2.55 diff -u -p -r1.756.2.55 common.inc --- includes/common.inc 20 May 2009 12:28:13 -0000 1.756.2.55 +++ includes/common.inc 11 Jun 2009 10:34:11 -0000 @@ -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 @@ -577,7 +584,7 @@ function drupal_error_handler($errno, $m return; } - if ($errno & (E_ALL)) { + if ($errno & (E_ALL ^ 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'); // For database errors, we want the line number/file name of the place that Index: includes/file.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/file.inc,v retrieving revision 1.121.2.6 diff -u -p -r1.121.2.6 file.inc --- includes/file.inc 13 Apr 2009 19:07:16 -0000 1.121.2.6 +++ includes/file.inc 11 Jun 2009 10:34:11 -0000 @@ -550,6 +550,8 @@ function file_save_upload($source, $vali $errors = array(); foreach ($validators as $function => $args) { array_unshift($args, $file); + // Make sure $file is passed around by reference. + $args[0] = &$file; $errors = array_merge($errors, call_user_func_array($function, $args)); } Index: includes/form.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/form.inc,v retrieving revision 1.265.2.25 diff -u -p -r1.265.2.25 form.inc --- includes/form.inc 26 May 2009 08:18:46 -0000 1.265.2.25 +++ includes/form.inc 11 Jun 2009 10:34:13 -0000 @@ -292,6 +292,10 @@ function form_get_cache($form_build_id, */ function drupal_execute($form_id, &$form_state) { $args = func_get_args(); + + // Make sure $form_state is passed around by reference. + $args[1] = &$form_state; + $form = call_user_func_array('drupal_retrieve_form', $args); $form['#post'] = $form_state['values']; drupal_prepare_form($form_id, $form, $form_state); Index: modules/system/system.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v retrieving revision 1.63.2.7 diff -u -p -r1.63.2.7 system.admin.inc --- modules/system/system.admin.inc 25 Feb 2009 11:38:41 -0000 1.63.2.7 +++ modules/system/system.admin.inc 11 Jun 2009 10:34:17 -0000 @@ -1971,7 +1971,7 @@ function theme_system_admin_by_module($m * An array of requirements. * @ingroup themeable */ -function theme_status_report(&$requirements) { +function theme_status_report($requirements) { $i = 0; $output = ''; foreach ($requirements as $requirement) { Index: modules/upload/upload.module =================================================================== RCS file: /cvs/drupal/drupal/modules/upload/upload.module,v retrieving revision 1.197.2.4 diff -u -p -r1.197.2.4 upload.module --- modules/upload/upload.module 12 Jan 2009 15:30:23 -0000 1.197.2.4 +++ modules/upload/upload.module 11 Jun 2009 10:34:17 -0000 @@ -513,7 +513,7 @@ function _upload_form($node) { * * @ingroup themeable */ -function theme_upload_form_current(&$form) { +function theme_upload_form_current($form) { $header = array('', t('Delete'), t('List'), t('Description'), t('Weight'), t('Size')); drupal_add_tabledrag('upload-attachments', 'order', 'sibling', 'upload-weight'); Index: modules/user/user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.module,v retrieving revision 1.892.2.13 diff -u -p -r1.892.2.13 user.module --- modules/user/user.module 27 Apr 2009 12:02:27 -0000 1.892.2.13 +++ modules/user/user.module 11 Jun 2009 10:34:18 -0000 @@ -1596,7 +1596,7 @@ function user_delete($edit, $uid) { db_query('DELETE FROM {authmap} WHERE uid = %d', $uid); $variables = array('%name' => $account->name, '%email' => '<'. $account->mail .'>'); watchdog('user', 'Deleted user: %name %email.', $variables, WATCHDOG_NOTICE); - module_invoke_all('user', 'delete', $edit, $account); + user_module_invoke('delete', $edit, $account); } /** @@ -1920,8 +1920,12 @@ function user_help($path, $arg) { 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 $user need to be passed by reference. + if (function_exists($function) && ($data = $function('categories', $null, $user, ''))) { $categories = array_merge($data, $categories); } } @@ -2459,8 +2463,10 @@ function user_register_validate($form, & 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)) { - $groups = array_merge_recursive($data, $groups); + $function = $module .'_user'; + // We can't use neither module_invoke nor user_module_invoke because we need the return value and by reference. + if (function_exists($function) && ($data = $function($hook, $edit, $account, $category))) { + $groups = array_merge($data, $groups); } } uasort($groups, '_user_sort'); Index: modules/user/user.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.pages.inc,v retrieving revision 1.11.2.1 diff -u -p -r1.11.2.1 user.pages.inc --- modules/user/user.pages.inc 8 Oct 2008 20:12:18 -0000 1.11.2.1 +++ modules/user/user.pages.inc 11 Jun 2009 10:34:19 -0000 @@ -148,7 +148,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();