From 4f8831dee13b706520a74910070ab107dad4b656 Mon Sep 17 00:00:00 2001
From: Adam <arcaneadam@MacBook-Pro-2.local>
Date: Mon, 28 Feb 2011 08:30:02 -0500
Subject: [PATCH 1/2] Issue #1056148 fixed Array issue

---
 location.module |   33 ++++++++++++++++++++++++++++++++-
 1 files changed, 32 insertions(+), 1 deletions(-)

diff --git a/location.module b/location.module
index 7adef9b..6ce97f9 100644
--- a/location.module
+++ b/location.module
@@ -468,6 +468,9 @@ function _location_expand_location($element) {
   }
 
   $element += element_info('fieldset');
+  //Add the pre/post render function to fix the issue in #1067890
+  $element['#pre_render'][] = "location_pre_render";
+  $element['#post_render'][] = "location_post_render";
   return $element;
 }
 
@@ -1571,7 +1574,7 @@ function template_preprocess_location(&$variables) {
   // Map link.
   $variables['map_link'] = '';
   if (!empty($location['map_link'])) {
-    // Do not use $location for generating the map link, since it will 
+    // Do not use $location for generating the map link, since it will
     // not contain the country if that field is hidden.
     $variables['map_link'] = location_map_link($variables['location']);
   }
@@ -1939,3 +1942,31 @@ function location_unimplemented_form($form, &$form_state, $arg = array()) {
   );
   return $form;
 }
+
+/*
+ * A post rendering fuction for location fields to offset the issue #1067890
+ *
+ * This function takes the action performed in the pre-render function and
+ * reverses it so that the location field still works.
+ *
+ * @see location_pre_render
+ */
+function location_post_render($children, &$element) {
+  $element['#value'] = $element['#pre_render_value'];
+  unset($element['#pre_render_value']);
+  return $children;
+}
+
+/*
+ * A pre rendering fuction for location fields to offset the issue #1067890
+ *
+ * Takes the value of the location $element and moves it to a seperate key before
+ * rendering takes place.
+ *
+ * @see location_post_render
+ */
+function location_pre_render(&$element) {
+  $element['#pre_render_value'] = $element['#value'];
+  unset($element['#value']);
+  return $element;
+}
-- 
1.6.6.1


From bd7ebe9bb5d189f2f81d525f02cc26544901b196 Mon Sep 17 00:00:00 2001
From: Adam <arcaneadam@MacBook-Pro-2.local>
Date: Mon, 28 Feb 2011 08:30:28 -0500
Subject: [PATCH 2/2] Issue #1056148 fixed Array issue

---
 location.module |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/location.module b/location.module
index 6ce97f9..1dbcd34 100644
--- a/location.module
+++ b/location.module
@@ -468,7 +468,7 @@ function _location_expand_location($element) {
   }
 
   $element += element_info('fieldset');
-  //Add the pre/post render function to fix the issue in #1067890
+  //Add the pre/post render function to fix the issue in #1056148
   $element['#pre_render'][] = "location_pre_render";
   $element['#post_render'][] = "location_post_render";
   return $element;
@@ -1944,7 +1944,7 @@ function location_unimplemented_form($form, &$form_state, $arg = array()) {
 }
 
 /*
- * A post rendering fuction for location fields to offset the issue #1067890
+ * A post rendering fuction for location fields to offset the issue #1056148
  *
  * This function takes the action performed in the pre-render function and
  * reverses it so that the location field still works.
@@ -1958,7 +1958,7 @@ function location_post_render($children, &$element) {
 }
 
 /*
- * A pre rendering fuction for location fields to offset the issue #1067890
+ * A pre rendering fuction for location fields to offset the issue #1056148
  *
  * Takes the value of the location $element and moves it to a seperate key before
  * rendering takes place.
-- 
1.6.6.1

