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 23:39:12.000000000 -0500
@@ -379,13 +379,15 @@ 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 (module_hook($module, $hook)) {
return call_user_func_array($function, $args);
}
}
+
/**
* Invoke a hook in all enabled modules that implement it.
*
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);
}
}