From 424ab5b68efaf90c274310a3cb1019dbd49296b1 Mon Sep 17 00:00:00 2001
From: Angie Byron <webchick@24967.no-reply.drupal.org>
Date: Mon, 20 Dec 2010 16:27:35 +0000
Subject: [PATCH] #1002708 by sun: Robustify instance settings instantiation to
 prevent fatal errors in buggy modules.

---
 modules/user/user.module | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/user/user.module b/modules/user/user.module
index 5411d35e9633..21272477536b 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -181,8 +181,9 @@ function user_uri($user) {
  */
 function user_field_info_alter(&$info) {
   // Add the 'user_register_form' instance setting to all field types.
-  foreach ($info as $field_type => $field_type_info) {
-    $info[$field_type]['instance_settings'] += array(
+  foreach ($info as $field_type => &$field_type_info) {
+    $field_type_info += array('instance_settings' => array());
+    $field_type_info['instance_settings'] += array(
       'user_register_form' => FALSE,
     );
   }
-- 
GitLab